From e2d7cd7ee15d0dd84ec93f5f0cee86aa29d0d9f5 Mon Sep 17 00:00:00 2001 From: Mike Date: Thu, 20 Nov 2025 15:50:06 +0100 Subject: [PATCH 1/2] #6 - update ecs config --- packages/php-linting-rules/configs/ecs.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/php-linting-rules/configs/ecs.php b/packages/php-linting-rules/configs/ecs.php index 20da4ef..459f0e0 100644 --- a/packages/php-linting-rules/configs/ecs.php +++ b/packages/php-linting-rules/configs/ecs.php @@ -42,7 +42,7 @@ ->withConfiguredRule(SlevomatCodingStandard\Sniffs\Classes\EnumCaseSpacingSniff::class, ['minLinesCountBeforeWithComment' => 1, 'maxLinesCountBeforeWithComment' => 1, 'minLinesCountBeforeWithoutComment' => 0, 'maxLinesCountBeforeWithoutComment' => 0]) ->withConfiguredRule(SlevomatCodingStandard\Sniffs\Classes\MethodSpacingSniff::class, ['minLinesCount' => 1, 'maxLinesCount' => 1]) ->withConfiguredRule(SlevomatCodingStandard\Sniffs\Classes\ParentCallSpacingSniff::class, ['linesCountBefore' => 0, 'linesCountAfter' => 1]) - ->withConfiguredRule(SlevomatCodingStandard\Sniffs\Classes\PropertySpacingSniff::class, ['minLinesCountBeforeWithComment' => 1, 'maxLinesCountBeforeWithComment' => 1, 'minLinesCountBeforeWithoutComment' => 0, 'maxLinesCountBeforeWithoutComment' => 0]) + ->withConfiguredRule(SlevomatCodingStandard\Sniffs\Classes\PropertySpacingSniff::class, ['minLinesCountBeforeWithComment' => 1, 'maxLinesCountBeforeWithComment' => 1, 'minLinesCountBeforeWithoutComment' => 1, 'maxLinesCountBeforeWithoutComment' => 1]) ->withConfiguredRule(SlevomatCodingStandard\Sniffs\Classes\TraitUseSpacingSniff::class, ['linesCountBeforeFirstUse' => 0, 'linesCountBeforeFirstUseWhenFirstInClass' => 0, 'linesCountBetweenUses' => 0, 'linesCountAfterLastUse' => 1, 'linesCountAfterLastUseWhenLastInClass' => 0]) ->withConfiguredRule(SlevomatCodingStandard\Sniffs\Commenting\DocCommentSpacingSniff::class, ['linesCountBeforeFirstContent' => 0, 'linesCountBetweenDescriptionAndAnnotations' => 1, 'linesCountBetweenDifferentAnnotationsTypes' => 0, 'linesCountAfterLastContent' => 0]) // ->withConfiguredRule(SlevomatCodingStandard\Sniffs\ControlStructures\BlockControlStructureSpacingSniff::class, ['linesCountBefore' => 1, 'linesCountBeforeFirst' => 1, 'linesCountAfter' => 1, 'linesCountAfterLast' => 1, 'controlStructures' => ['if', 'switch', 'for', 'foreach', 'while', 'do']]) @@ -329,18 +329,24 @@ SlevomatCodingStandard\Sniffs\Variables\UnusedVariableSniff::class, ])->withSkip([ SlevomatCodingStandard\Sniffs\Functions\UnusedParameterSniff::class => [ - getcwd() . '/app/Traits', - getcwd() . '/app/Policies', getcwd() . '/app/Models', + getcwd() . '/app/Policies', + getcwd() . '/app/Repositories/QuerySorts', + getcwd() . '/app/Scopes', + getcwd() . '/app/Traits', + getcwd() . '/app/Data/Casts', + getcwd() . '/app/Providers', ], SlevomatCodingStandard\Sniffs\Functions\DisallowEmptyFunctionSniff::class => [ getcwd() . '/app/Providers', ], SlevomatCodingStandard\Sniffs\TypeHints\PropertyTypeHintSniff::class => [ + getcwd() . '/app/Console/Commands', getcwd() . '/app/Models', ], SlevomatCodingStandard\Sniffs\TypeHints\ParameterTypeHintSniff::class => [ - getcwd() . '/app/Models', + getcwd() . '/app/Data/Casts', + getcwd() . '/app/Models/User/User.php', ], PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer::class => [ getcwd() . '/app/Models', @@ -352,4 +358,7 @@ getcwd() . '/database/seeders', getcwd() . '/database/migrations', ], + SlevomatCodingStandard\Sniffs\TypeHints\ReturnTypeHintSniff::class => [ + getcwd() . '/app/Models/User/User.php', + ] ]); From 6b5bff2090ee0c8b8ec515374c05d230e9f2afc6 Mon Sep 17 00:00:00 2001 From: Mike Date: Thu, 20 Nov 2025 15:51:19 +0100 Subject: [PATCH 2/2] Update packages/php-linting-rules/configs/ecs.php Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- packages/php-linting-rules/configs/ecs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/php-linting-rules/configs/ecs.php b/packages/php-linting-rules/configs/ecs.php index 459f0e0..15d52df 100644 --- a/packages/php-linting-rules/configs/ecs.php +++ b/packages/php-linting-rules/configs/ecs.php @@ -360,5 +360,5 @@ ], SlevomatCodingStandard\Sniffs\TypeHints\ReturnTypeHintSniff::class => [ getcwd() . '/app/Models/User/User.php', - ] + ], ]);