Skip to content

Skip #[Route] attribute actions in NoPublicNonActionMethodInControllerRule - #371

Merged
TomasVotruba merged 1 commit into
mainfrom
fix-route-attribute-controller-action
Oct 14, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
fix-route-attribute-controller-action

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Fixes #368. Closes #370.

NoPublicNonActionMethodInControllerRule only treated *Action() and __invoke() as route actions. Attribute-routed controllers with conventional method names were reported as needing to be made private, which breaks the route.

Methods carrying a Symfony\Component\Routing\Attribute\Route or legacy Symfony\Component\Routing\Annotation\Route attribute are now skipped, the same way #[Required] setters are.

Fixture by @M-arcus from #370.

@TomasVotruba
TomasVotruba merged commit 9882995 into main Oct 14, 2026
9 checks passed
@TomasVotruba
TomasVotruba deleted the fix-route-attribute-controller-action branch October 14, 2026 15:13
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.

NoPublicNonActionMethodInControllerRule reports attribute-routed actions (#[Route])

1 participant