Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
More precise types after assignment when strict-types=0 #3965
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
More precise types after assignment when strict-types=0 #3965
Changes from 34 commits
475c75e
f1b04fc
e1455c0
536af14
47a1d73
6c4aea1
cebbfcb
6f6bca9
411e447
2625bb8
72aa6ab
7a95a46
4d20e2a
ccb1889
78e8df9
872af82
1a8c921
3a64515
2c75fb4
65b9d3b
604aed1
016c260
da17fe4
9e815d3
76e1258
4bb13d8
d338a47
9d19f30
0560ae2
113c7d4
3d34649
c16582a
c6db4e7
61e0eea
a8abeae
016d44a
95186fe
b14719a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the object isn't a Stringable, this should just return
$this
. But instead it will return ErrorType.Also I'm not sure what happens with
BcMath\Number
in strict_types=1 or 0.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added tests with links to 3v4l.org
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opened a PHPStorm bug: https://youtrack.jetbrains.com/issue/WI-81263/Property-must-be-of-type-string-callable-provided-false-positive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be fair PHPStan also reports an error for that (which is correct, we mostly don't differentiate between strict_types 1 or 0 in
Type::accepts()
.