Skip to content

[CodeQuality] Skip Common Entity contains subnamespaces on ControllerMethodInjectionToConstructorRector#878

Merged
TomasVotruba merged 3 commits intomainfrom
code-q
Nov 22, 2025
Merged

[CodeQuality] Skip Common Entity contains subnamespaces on ControllerMethodInjectionToConstructorRector#878
TomasVotruba merged 3 commits intomainfrom
code-q

Conversation

@samsonasik
Copy link
Copy Markdown
Member

Per #876 (review)

Entity classes can be fetched via ValueResolver services. This PR apply skip if the name contains \\Entity or \\Document or \\Model

@samsonasik
Copy link
Copy Markdown
Member Author

All checks have passed 🎉 @TomasVotruba I think it is ready 👍

@TomasVotruba
Copy link
Copy Markdown
Member

LGTM 👍

@TomasVotruba TomasVotruba merged commit fee9474 into main Nov 22, 2025
5 checks passed
@TomasVotruba TomasVotruba deleted the code-q branch November 22, 2025 09:43
/**
* @var string[]
*/
private const COMMON_ENTITY_CONTAINS_SUBNAMESPACES = ['\\Entity', '\\Document', '\\Model'];
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The \\ prefix somehow removed under single quote on scoped build

rectorphp/rector@100442a#diff-2beb8610233424551baf38f6ba20dec69759c01de3abaa2ef4bd0f7f668079f1

On our usecase, this is still ok, but for future string related backslash usage that important(eg: regex), the double quote should be used.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

2 participants