Skip to content

Commit

Permalink
update ECS to v12 and fix config
Browse files Browse the repository at this point in the history
  • Loading branch information
robinklaassen committed Nov 1, 2023
1 parent 425dcdd commit 27574a6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 23 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"laravel/homestead": "^14.0",
"barryvdh/laravel-debugbar": "^3.3",
"laravel/ui": "^4.0",
"symplify/easy-coding-standard": "^11.0"
"symplify/easy-coding-standard": "^12.0"
},
"autoload": {
"psr-4": {
Expand Down
16 changes: 8 additions & 8 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 15 additions & 14 deletions ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,26 @@
declare(strict_types=1);

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

return static function (ECSConfig $config): void {
$config->import(SetList::COMMON);
$config->import(SetList::PSR_12);
$config->import(SetList::CLEAN_CODE);
$config->sets([
SetList::COMMON,
SetList::PSR_12,
SetList::CLEAN_CODE,
]);

// need more fixers? Search them on: https://mlocati.github.io/php-cs-fixer-configurator
$services = $config->services();
$services->set(PhpCsFixer\Fixer\Comment\SingleLineCommentStyleFixer::class);
$services->set(PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::class);
$services->set(PhpCsFixer\Fixer\PhpUnit\PhpUnitMethodCasingFixer::class);
$services->set(PhpCsFixer\Fixer\PhpUnit\PhpUnitSetUpTearDownVisibilityFixer::class);
$services->set(PhpCsFixer\Fixer\Whitespace\ArrayIndentationFixer::class);
$services->set(PhpCsFixer\Fixer\Alias\ArrayPushFixer::class);
$config->rules([
PhpCsFixer\Fixer\Comment\SingleLineCommentStyleFixer::class,
PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::class,
PhpCsFixer\Fixer\PhpUnit\PhpUnitMethodCasingFixer::class,
PhpCsFixer\Fixer\PhpUnit\PhpUnitSetUpTearDownVisibilityFixer::class,
PhpCsFixer\Fixer\Whitespace\ArrayIndentationFixer::class,
PhpCsFixer\Fixer\Alias\ArrayPushFixer::class,
]);

$parameters = $config->parameters();
$parameters->set(Option::PATHS, [
$config->paths([
__DIR__ . '/app/',
__DIR__ . '/config/',
__DIR__ . '/database/',
Expand All @@ -31,7 +32,7 @@
__DIR__ . '/ecs.php',
]);

$parameters->set(Option::SKIP, [
$config->skip([
PhpCsFixer\Fixer\PhpUnit\PhpUnitStrictFixer::class,
]);
};

0 comments on commit 27574a6

Please sign in to comment.