Skip to content

Make complexity/configurable/static sets toggleable, drop duplicate naming-rules include - #304

Merged
TomasVotruba merged 1 commit into
mainfrom
tv-toggle-rule-sets
Sep 23, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
tv-toggle-rule-sets

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Problem

Running PHPStan in a project that uses phpstan/extension-installer and also includes config/symplify-rules.neon prints:

This file is included multiple times:
- .../config/naming-rules.neon

naming-rules.neon is auto-loaded by the extension-installer (via extra.phpstan.includes) and gated by the symplify.naming toggle. But symplify-rules.neon includes it a second time, unconditionally - hence the duplicate.

Change

  • Drop the redundant naming-rules.neon include from symplify-rules.neon. It stays enabled via the existing symplify.naming: true default and the auto-load.
  • Give code-complexity-rules.neon, configurable-rules.neon and static-rules.neon the same conditionalTags treatment as naming-rules.neon, gated by new symplify.complexity, symplify.configurable and symplify.static params (all default true, so no behavior change on upgrade).

Now each set can be turned off from config:

parameters:
    symplify:
        complexity: false
        configurable: false
        static: false

Verification

  • Toggle proven for all three registration styles (rules: shorthand, explicit services:, anonymous services with arguments): with the flag true the rule fires, with false it is silent, params resolve with no config errors.
  • Full test suite green (371 tests).

@TomasVotruba
TomasVotruba merged commit a673358 into main Sep 23, 2026
8 checks passed
@TomasVotruba
TomasVotruba deleted the tv-toggle-rule-sets branch September 23, 2026 10:27
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