| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
- Update ValidFunctionNameSniff to flag underscore-prefixed protected/private methods (except Entity accessor/mutator pattern _get*, _set*) - Add ValidPropertyNameSniff to flag underscore-prefixed properties - Remove PSR2.Classes.PropertyDeclaration.Underscore exclusion from ruleset - Add new Slevomat sniffs: - RequireNullCoalesceEqualOperator - RequireNullSafeObjectOperator - RequireSelfReference - NullTypeHintOnLastPosition - Fix $_magicMethods property naming in sniff itself - Add T_ENUM support to ValidFunctionNameSniff
|
You're right - removed the custom ValidPropertyNameSniff. The PSR2 built-in handles properties. Kept the custom ValidFunctionNameSniff though, since it allows the Entity accessor/mutator pattern (_getName, _setField) which the PSR2 method sniff would flag. |
Sorry, something went wrong.
|
The base is off, should target 6.x right? |
Sorry, something went wrong.
Relax the ValidEnumNameSniff to allow omitting the "Enum" suffix when the enum is in a namespace containing "Enum" as a segment (e.g., `App\Model\Enum\Status` is now valid without the suffix). This avoids redundant naming like `App\Model\Enum\FooBarEnum`. Refs #425
Fix conflict between TypeHintSniff and Slevomat null position sniffs
Partial namespace references like Mockery\MockInterface were not being flagged by ReferenceUsedNamesOnly because Slevomat's allowPartialUses defaults to true. Set it to false so such references are required to be imported via a use statement.
| Back | FazBrowse Home | New Git URL |
Summary
This PR introduces stricter naming convention enforcement for CakePHP 6.x, aligned with PSR naming conventions.
New Sniffs
ValidPropertyNameSniff (new)
ValidFunctionNameSniff (updated)
Ruleset Changes
Migration
Projects upgrading to CakePHP 6.x should:
The cakephp/upgrade tool has Rector rules to automate these renames.
Tests
All existing tests pass, new test cases added for: