Skip to content

[dx] Group naming rules under 'naming' parameter - #301

Merged
TomasVotruba merged 3 commits into
mainfrom
naming-param
Sep 22, 2026
Merged

TomasVotruba merged 3 commits into
mainfrom
naming-param

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Groups all naming rules under a single naming parameter, mirroring the existing mocks / ctor pattern - but on by default.

What

  • config/naming-rules.neon now registers its rules via conditionalTags keyed on %symplify.naming%, and absorbs the 3 namespace rules moved out of static-rules.neon:
    • RequireExceptionNamespaceRule
    • RequireAttributeNamespaceRule
    • CheckRequiredInterfaceInContractNamespaceRule (interface must live in a "Contract" namespace)
  • naming: true added to parameters + naming: bool() to the schema in config/phpstan-extensions.neon.
  • config/naming-rules.neon added to composer.json extra.phpstan.includes, so it auto-loads via phpstan/extension-installer and stays on unless disabled.

Turn all naming rules off with:

parameters:
    symplify:
        naming: false

Notes

  • Since naming-rules.neon now auto-loads, it was removed from the README includes: example - keeping a manual include alongside the auto-load would double-register the services. Existing users should drop that manual include line.
  • Per-rule README snippets that showed manual rules: registration for these rules were removed to avoid copy-paste double registration.

ECS, Rector, PHPStan and PHPUnit (376 tests) all pass.

@TomasVotruba TomasVotruba changed the title Group naming rules under 'naming' parameter [dx] Group naming rules under 'naming' parameter Sep 22, 2026
@TomasVotruba
TomasVotruba merged commit 2d2f20b into main Sep 22, 2026
8 checks passed
@TomasVotruba
TomasVotruba deleted the naming-param branch September 22, 2026 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant