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 type specification of various string functions with constant strings in a falsey context #1488

Merged
merged 1 commit into from Jun 30, 2022

Conversation

herndlm
Copy link
Contributor

@herndlm herndlm commented Jun 30, 2022

Closes phpstan/phpstan#7555

Apparently this would return that some constant string is surely not e.g. 'ab' in a falsey scope but at the same time the scope has the info that it surely is 'ab' in a truthy scope. And that seams lead to a *NEVER* type.

The blocks before this one, that deal with a related thing, do it a bit different but very similar, e.g. https://github.com/phpstan/phpstan-src/blob/1.8.0/src/Analyser/TypeSpecifier.php#L237

@herndlm herndlm marked this pull request as ready for review June 30, 2022 20:57
@ondrejmirtes ondrejmirtes merged commit cd7f82c into phpstan:1.8.x Jun 30, 2022
@ondrejmirtes
Copy link
Member

Thank you!

@staabm
Copy link
Contributor

staabm commented Jul 1, 2022

Thx Martin!

@herndlm herndlm deleted the fix-7555 branch July 1, 2022 08: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
3 participants