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

Fix false positive on nullable public properties #145

Merged
merged 1 commit into from
Feb 14, 2025

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Feb 12, 2025

before this PR a false positive was reported when a public property was used, but the code did not explicitly eliminate a possible null value from a union

@staabm staabm marked this pull request as ready for review February 12, 2025 13:40
public function doFoo(self $foo)
{
$x = $foo->getBar();
echo $x->property;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

unhandled case was here: $x is null|PublicPropertyClass, which the collector did not accept as a property fetch of PublicPropertyClass->property

@staabm
Copy link
Contributor Author

staabm commented Feb 14, 2025

@TomasVotruba do you have a moment to merge and release this fix? :-)

@TomasVotruba TomasVotruba merged commit 1294eff into TomasVotruba:main Feb 14, 2025
8 checks passed
@TomasVotruba
Copy link
Owner

Sure, thank you for improvements 🤙👌

@staabm staabm deleted the null-pub branch February 14, 2025 09:12
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.

3 participants