Skip to content

Fix false positive of access to private property of parent class#1953

Merged
ondrejmirtes merged 4 commits intophpstan:1.9.xfrom
tyabu12:bug-2435
Nov 9, 2022
Merged

Fix false positive of access to private property of parent class#1953
ondrejmirtes merged 4 commits intophpstan:1.9.xfrom
tyabu12:bug-2435

Conversation

@tyabu12
Copy link
Copy Markdown
Contributor

@tyabu12 tyabu12 commented Nov 2, 2022

@herndlm
Copy link
Copy Markdown
Contributor

herndlm commented Nov 9, 2022

according to the new bot, your PR would be closing 3 issues 🎉 https://github.com/phpstan/phpstan-src/actions/runs/3428507295

@ondrejmirtes
Copy link
Copy Markdown
Member

Please add regression tests for them too :) Thank you.

@ondrejmirtes
Copy link
Copy Markdown
Member

When I get around to it, I'll add some smart commenting feature on PRs too. My idea is that when the bot finds changes, it adds a comment with them, but with further force-pushes, it doesn't add new comments, it just edits the first one.

@ondrejmirtes ondrejmirtes merged commit b4ac8a1 into phpstan:1.9.x Nov 9, 2022
@ondrejmirtes
Copy link
Copy Markdown
Member

Perfect, thank you!

@tyabu12 tyabu12 deleted the bug-2435 branch November 9, 2022 14:14
@tyabu12
Copy link
Copy Markdown
Contributor Author

tyabu12 commented Nov 9, 2022

@ondrejmirtes
Thank you for merging!
Could you also close the following issue that herndlm mentions?

@ondrejmirtes
Copy link
Copy Markdown
Member

Don't worry, I always do that, that's what the bot is for 😊

@staabm
Copy link
Copy Markdown
Contributor

staabm commented Nov 9, 2022

@tyabu12 I am wondering whether we have the same problem in static context in AccessPrivatePropertyThroughStaticRule

https://phpstan.org/r/a757dd9c-01fa-450a-96f6-52a10feab73f
https://3v4l.org/YmKc6

@tyabu12
Copy link
Copy Markdown
Contributor Author

tyabu12 commented Nov 9, 2022

@staabm
It seems that we still have the same problem in the rule.
Could you open new issue for it?

@staabm
Copy link
Copy Markdown
Contributor

staabm commented Nov 9, 2022

here we go: phpstan/phpstan#8333

@tyabu12
Copy link
Copy Markdown
Contributor Author

tyabu12 commented Nov 9, 2022

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.

False positive: Access to private property $root of parent class Foo.

4 participants