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 2, 2024
1 parent 5d9d810 commit 136f064
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/code-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ jobs:
- name: Composer
run: composer install --no-progress

- name: Check CS
run: vendor/bin/ecs

- name: PHPUnit
run: vendor/bin/phpunit --coverage-clover=coverage.xml
env:
Expand Down
18 changes: 9 additions & 9 deletions ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,32 @@
use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;

return static function (ECSConfig $ecsConfig): void {
$ecsConfig->paths([
return ECSConfig::configure()
->withPaths([
__DIR__ . '/bin',
__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."
$ecsConfig->ruleWithConfiguration(
->withConfiguredRule(
\PhpCsFixer\Fixer\FunctionNotation\FunctionDeclarationFixer::class,
[
'closure_fn_spacing' => 'none',
]
);
};

0 comments on commit 136f064

Please sign in to comment.