Skip to content

[removal] Remove too strict PreferInlineTraitRule and its collectors - #344

Merged
TomasVotruba merged 2 commits into
mainfrom
remove-prefer-inline-trait-rule
Oct 9, 2026
Merged

TomasVotruba merged 2 commits into
mainfrom
remove-prefer-inline-trait-rule

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Why

PreferInlineTraitRule nagged to inline any trait used at most maxUsage times (2 by default). Too strict - a small shared trait is a legitimate way to compose behavior, and "inline it" is a style opinion, not a bug.

It also sits oddly next to the package's own stance of discouraging traits in the first place.

What

  • Remove PreferInlineTraitRule, its symplify.preferInlineTrait identifier, and its test.
  • Remove the two collectors it was the sole user of: TraitDefinitionCollector, TraitUsageCollector.
  • Remove config/inline-trait-rules.neon and its composer.json include entry.
  • Remove the inlineTrait toggle parameter from config/phpstan-extensions.neon.
  • Remove its README section.

Checks

ECS, PHPStan, Rector, Neon lint and PHPUnit all green.

@TomasVotruba TomasVotruba changed the title Remove too strict PreferInlineTraitRule and its collectors [removal] Remove too strict PreferInlineTraitRule and its collectors Oct 9, 2026
@TomasVotruba
TomasVotruba force-pushed the remove-prefer-inline-trait-rule branch from 354051a to a64e668 Compare October 9, 2026 09:28
@TomasVotruba
TomasVotruba enabled auto-merge (squash) October 9, 2026 09:29
@TomasVotruba
TomasVotruba merged commit 09afc5f into main Oct 9, 2026
9 checks passed
@TomasVotruba
TomasVotruba deleted the remove-prefer-inline-trait-rule branch October 9, 2026 09:30
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