Skip to content

Commit

Permalink
[TASK] Add more PHP CS Fixer rules
Browse files Browse the repository at this point in the history
  • Loading branch information
simonschaufi committed Jun 17, 2024
1 parent 8dce09a commit a6f3c6a
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
declare(strict_types=1);

use PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\AssignmentInConditionSniff;
use PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer;
use PhpCsFixer\Fixer\ControlStructure\YodaStyleFixer;
use PhpCsFixer\Fixer\Import\NoUnusedImportsFixer;
use PhpCsFixer\Fixer\Operator\OperatorLinebreakFixer;
use PhpCsFixer\Fixer\Phpdoc\GeneralPhpdocAnnotationRemoveFixer;
use PhpCsFixer\Fixer\Phpdoc\NoSuperfluousPhpdocTagsFixer;
Expand All @@ -15,19 +17,6 @@
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;

return static function (ECSConfig $ecsConfig): void {
$ecsConfig->rule(StandaloneLineInMultilineArrayFixer::class);
$ecsConfig->rule(ArrayOpenerAndCloserNewlineFixer::class);

$ecsConfig->ruleWithConfiguration(GeneralPhpdocAnnotationRemoveFixer::class, [
'annotations' => ['throws', 'author', 'package', 'group'],
]);

$ecsConfig->ruleWithConfiguration(NoSuperfluousPhpdocTagsFixer::class, [
'allow_mixed' => true,
]);

$ecsConfig->sets([SetList::PSR_12, SetList::SYMPLIFY, SetList::COMMON, SetList::CLEAN_CODE]);

$ecsConfig->paths([
__DIR__ . '/src',
__DIR__ . '/tests',
Expand All @@ -46,6 +35,20 @@
DeclareStrictTypesFixer::class => ['*/Fixture/*', '*/Assertions/*'],
]);

$ecsConfig->sets([SetList::PSR_12, SetList::SYMPLIFY, SetList::COMMON, SetList::CLEAN_CODE]);

$ecsConfig->ruleWithConfiguration(GeneralPhpdocAnnotationRemoveFixer::class, [
'annotations' => ['throws', 'author', 'package', 'group'],
]);

$ecsConfig->ruleWithConfiguration(NoSuperfluousPhpdocTagsFixer::class, [
'allow_mixed' => true,
]);

$ecsConfig->rule(NoUnusedImportsFixer::class);
$ecsConfig->rule(ArraySyntaxFixer::class);
$ecsConfig->rule(StandaloneLineInMultilineArrayFixer::class);
$ecsConfig->rule(ArrayOpenerAndCloserNewlineFixer::class);
$ecsConfig->rule(DeclareStrictTypesFixer::class);
$ecsConfig->rule(LineLengthFixer::class);
$ecsConfig->rule(YodaStyleFixer::class);
Expand Down

0 comments on commit a6f3c6a

Please sign in to comment.