Skip to content

[removal] Remove too strict and unregistered NoProtectedClassStmtRule - #343

Merged
TomasVotruba merged 2 commits into
mainfrom
remove-no-protected-class-stmt-rule
Oct 9, 2026
Merged

TomasVotruba merged 2 commits into
mainfrom
remove-no-protected-class-stmt-rule

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Why

NoProtectedClassStmtRule forbade every protected member ("use clear interface contract instead"). Two problems:

  • Too strict - protected is a normal, legitimate visibility; banning it wholesale is dogmatic.
  • Unreachable - the rule was registered in no shipped config and not listed in composer.json extra.phpstan.includes, so no user ever ran it. It shipped as dead code plus a test.

What

  • Remove the rule, its test, and its symplify.noProtectedClassStmt identifier.
  • Drop the now-unused MethodName::SET_UP and MethodName::TEAR_DOWN constants (only this rule used them).
  • Remove its README section.

Checks

ECS, PHPStan, Rector and PHPUnit all green.

@TomasVotruba TomasVotruba changed the title Remove too strict and unregistered NoProtectedClassStmtRule [removal] Remove too strict and unregistered NoProtectedClassStmtRule Oct 9, 2026
@TomasVotruba
TomasVotruba enabled auto-merge (squash) October 9, 2026 09:28
@TomasVotruba
TomasVotruba merged commit 3291a83 into main Oct 9, 2026
9 checks passed
@TomasVotruba
TomasVotruba deleted the remove-no-protected-class-stmt-rule branch October 9, 2026 09:28
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