Skip to content

Commit b0978fb

Browse files
authored
Merge pull request #4999 from paulbalandan/space-after-comment-start-fixer
2 parents 77b7910 + dcb54b3 commit b0978fb

File tree

26 files changed

+216
-107
lines changed

26 files changed

+216
-107
lines changed

.no-header.php-cs-fixer.dist.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Nexus\CsConfig\Factory;
1515
use PhpCsFixer\Finder;
1616
use Utils\PhpCsFixer\CodeIgniter4;
17+
use Utils\PhpCsFixer\Fixer\Comment\SpaceAfterCommentStartFixer;
1718

1819
$finder = Finder::create()
1920
->files()
@@ -26,8 +27,14 @@
2627
$overrides = [];
2728

2829
$options = [
29-
'cacheFile' => 'build/.no-header.php-cs-fixer.cache',
30-
'finder' => $finder,
30+
'cacheFile' => 'build/.no-header.php-cs-fixer.cache',
31+
'finder' => $finder,
32+
'customFixers' => [
33+
new SpaceAfterCommentStartFixer(),
34+
],
35+
'customRules' => [
36+
'CodeIgniter4/space_after_comment_start' => true,
37+
],
3138
];
3239

3340
return Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();

.php-cs-fixer.dist.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Nexus\CsConfig\Factory;
1515
use PhpCsFixer\Finder;
1616
use Utils\PhpCsFixer\CodeIgniter4;
17+
use Utils\PhpCsFixer\Fixer\Comment\SpaceAfterCommentStartFixer;
1718

1819
$finder = Finder::create()
1920
->files()
@@ -34,8 +35,14 @@
3435
$overrides = [];
3536

3637
$options = [
37-
'cacheFile' => 'build/.php-cs-fixer.cache',
38-
'finder' => $finder,
38+
'cacheFile' => 'build/.php-cs-fixer.cache',
39+
'finder' => $finder,
40+
'customFixers' => [
41+
new SpaceAfterCommentStartFixer(),
42+
],
43+
'customRules' => [
44+
'CodeIgniter4/space_after_comment_start' => true,
45+
],
3946
];
4047

4148
return Factory::create(new CodeIgniter4(), $overrides, $options)->forLibrary(

system/BaseModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1327,7 +1327,7 @@ public function validate($data): bool
13271327
return true;
13281328
}
13291329

1330-
//Validation requires array, so cast away.
1330+
// Validation requires array, so cast away.
13311331
if (is_object($data)) {
13321332
$data = (array) $data;
13331333
}

system/Cache/Handlers/MemcachedHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public function decrement(string $key, int $offset = 1)
220220

221221
$key = static::validateKey($key, $this->prefix);
222222

223-
//FIXME: third parameter isn't other handler actions.
223+
// FIXME: third parameter isn't other handler actions.
224224
// @phpstan-ignore-next-line
225225
return $this->memcached->decrement($key, $offset, $offset, 60);
226226
}

system/Common.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -978,8 +978,8 @@ function single_service(string $name, ...$params)
978978
}
979979

980980
if (! function_exists('slash_item')) {
981-
//Unlike CI3, this function is placed here because
982-
//it's not a config, or part of a config.
981+
// Unlike CI3, this function is placed here because
982+
// it's not a config, or part of a config.
983983
/**
984984
* Fetch a config file item with slash appended (if not empty)
985985
*

system/Database/BaseConnection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ abstract public function reconnect();
461461
*/
462462
public function getConnection(?string $alias = null)
463463
{
464-
//@todo work with read/write connections
464+
// @todo work with read/write connections
465465
return $this->connID;
466466
}
467467

system/Debug/Exceptions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function __construct(ExceptionsConfig $config, IncomingRequest $request,
8585
*/
8686
public function initialize()
8787
{
88-
//Set the Exception Handler
88+
// Set the Exception Handler
8989
set_exception_handler([$this, 'exceptionHandler']);
9090

9191
// Set the Error Handler

system/Entity/Entity.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ protected function castAs($value, string $attribute, string $method = 'get')
353353
$type = substr($type, 1);
354354
}
355355

356-
//In order not to create a separate handler for the
356+
// In order not to create a separate handler for the
357357
// json-array type, we transform the required one.
358358
$type = $type === 'json-array' ? 'json[array]' : $type;
359359

@@ -363,7 +363,7 @@ protected function castAs($value, string $attribute, string $method = 'get')
363363

364364
$params = [];
365365

366-
//Attempt to retrieve additional parameters if specified
366+
// Attempt to retrieve additional parameters if specified
367367
// type[param, param2,param3]
368368
if (preg_match('/^(.+)\[(.+)\]$/', $type, $matches)) {
369369
$type = $matches[1];

system/HTTP/Files/UploadedFile.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public function __construct(string $path, string $originalName, ?string $mimeTyp
127127
public function move(string $targetPath, ?string $name = null, bool $overwrite = false)
128128
{
129129
$targetPath = rtrim($targetPath, '/') . '/';
130-
$targetPath = $this->setPath($targetPath); //set the target path
130+
$targetPath = $this->setPath($targetPath); // set the target path
131131

132132
if ($this->hasMoved) {
133133
throw HTTPException::forAlreadyMoved();
@@ -169,7 +169,7 @@ protected function setPath(string $path): string
169169
{
170170
if (! is_dir($path)) {
171171
mkdir($path, 0777, true);
172-
//create the index.html file
172+
// create the index.html file
173173
if (! is_file($path . 'index.html')) {
174174
$file = fopen($path . 'index.html', 'x+b');
175175
fclose($file);

system/Helpers/inflector_helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function singular(string $string): string
2727
return $result;
2828
}
2929

30-
//Arranged in order.
30+
// Arranged in order.
3131
$singularRules = [
3232
'/(matr)ices$/' => '\1ix',
3333
'/(vert|ind)ices$/' => '\1ex',

0 commit comments

Comments
 (0)