Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Privatization] Skip protected property used in parent class on PrivatizeFinalClassPropertyRector #1501

Merged
merged 5 commits into from
Dec 15, 2021

Conversation

samsonasik
Copy link
Member

Closes #1489


$methods = $classLike->getMethods();
foreach ($methods as $method) {
$isFound = (bool) $this->betterNodeFinder->findFirst((array) $method->stmts, function (Node $subNode) use ($propertyName): bool {
Copy link
Member Author

Choose a reason for hiding this comment

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

I tried using findFirstInFunctionLikeScoped() which check only in scoped of classmethod, but seems fails got parent type, it possibly due to classmethod of the class pulled from AstResolver which make the information of parent is not filled, so I used findFirst() instead.

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba it is ready for review.

@TomasVotruba TomasVotruba merged commit 303c1b0 into main Dec 15, 2021
@TomasVotruba TomasVotruba deleted the close-1489 branch December 15, 2021 08:34
@TomasVotruba
Copy link
Member

Thank you

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.

4 participants