Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR updates the ECS (Easy Coding Standard) configuration for PHP linting rules. It modifies the PropertySpacingSniff rule to require blank lines before properties regardless of whether they have comments, and adds several skip rules to exclude specific directories and files from certain code quality checks.
Key changes:
- Modified PropertySpacingSniff to enforce consistent blank line spacing before properties
- Added skip configurations for multiple sniffs targeting specific Laravel application directories
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ]) | ||
| ->withSkip([ | ||
| PhpCsFixer\Fixer\AttributeNotation\OrderedAttributesFixer::class => [ | ||
| getcwd() . '/app/Data', |
There was a problem hiding this comment.
Using getcwd() for path construction is fragile and assumes the command is always run from a specific directory. Consider using __DIR__ or a more reliable base path resolution mechanism to ensure paths work correctly regardless of where the command is executed from.
| SlevomatCodingStandard\Sniffs\Functions\UnusedParameterSniff::class => [ | ||
| getcwd() . '/app/Models', | ||
| getcwd() . '/app/Policies', | ||
| getcwd() . '/app/Repositories/QuerySorts', | ||
| getcwd() . '/app/Scopes', | ||
| getcwd() . '/app/Traits', | ||
| getcwd() . '/app/Data/Casts', |
There was a problem hiding this comment.
[nitpick] Skipping UnusedParameterSniff for so many directories (7 different paths) may hide genuine code quality issues. Consider addressing unused parameters in these locations or documenting why these specific directories require this exception.
| SlevomatCodingStandard\Sniffs\Functions\UnusedParameterSniff::class => [ | |
| getcwd() . '/app/Models', | |
| getcwd() . '/app/Policies', | |
| getcwd() . '/app/Repositories/QuerySorts', | |
| getcwd() . '/app/Scopes', | |
| getcwd() . '/app/Traits', | |
| getcwd() . '/app/Data/Casts', | |
| SlevomatCodingStandard\Sniffs\Functions\UnusedParameterSniff::class => [ | |
| // Models: Often must implement framework interfaces with unused parameters. | |
| getcwd() . '/app/Models', | |
| // Policies: Method signatures required by Laravel, may have unused parameters. | |
| getcwd() . '/app/Policies', | |
| // QuerySorts: Custom sorting interfaces may require unused parameters. | |
| getcwd() . '/app/Repositories/QuerySorts', | |
| // Scopes: Laravel scopes require specific method signatures. | |
| getcwd() . '/app/Scopes', | |
| // Traits: Traits must match interface signatures, may have unused parameters. | |
| getcwd() . '/app/Traits', | |
| // Data Casts: Custom cast classes may require unused parameters for interface compliance. | |
| getcwd() . '/app/Data/Casts', | |
| // Providers: Service providers may have unused parameters for compatibility. |
closes #6