Skip to content

Commit

Permalink
Upgrade ECS to v12.1
Browse files Browse the repository at this point in the history
New config syntax.
'common' no longer includes 'strict'.
  • Loading branch information
chrisminett committed Feb 3, 2024
1 parent 7e85700 commit 2f93c61
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"require-dev": {
"ext-zip": "*",
"phpunit/phpunit": "^9",
"symplify/easy-coding-standard": "^11"
"symplify/easy-coding-standard": "^12"
},
"autoload": {
"psr-4": {
Expand Down
25 changes: 16 additions & 9 deletions ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,33 @@
declare(strict_types=1);

use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Option;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;

return static function (ECSConfig $ecsConfig): void {
$ecsConfig->paths([
return ECSConfig::configure()
->withPaths([
__DIR__ . '/src',
__DIR__ . '/tests',
]);
])

$ecsConfig->sets([
->withSets([
SetList::COMMON,
SetList::PSR_12,
]);
SetList::STRICT,
])

$ecsConfig->skip([
->withSkip([
// Remove sniff, from common/control-structures
\PhpCsFixer\Fixer\ClassNotation\OrderedClassElementsFixer::class,

// Remove sniff, from common/spaces
\PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer::class,
\PhpCsFixer\Fixer\CastNotation\CastSpacesFixer::class,
]);
};
])

// PER Coding Style 7.1: "The `fn` keyword MUST NOT be succeeded by a space."
->withConfiguredRule(
\PhpCsFixer\Fixer\FunctionNotation\FunctionDeclarationFixer::class,
[
'closure_fn_spacing' => 'none',
]
);
2 changes: 1 addition & 1 deletion src/Csv.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public function key(): ?int

public function valid(): bool
{
return ($this->current !== false);
return $this->current !== false;
}

public function rewind(): void
Expand Down

0 comments on commit 2f93c61

Please sign in to comment.