-
Notifications
You must be signed in to change notification settings - Fork 545
Decorate ImpossibleCheckTypeHelper with reason #3579
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
Conversation
af42c4a to
3088f94
Compare
| "• 'publishDate' is not lowercase. | ||
| • 'approvedAt' is not lowercase. | ||
| • 'allowedValues' is not lowercase.", |
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.
Since the comparison is between 'publishDate'|'approvedAt'|'allowedValues' and lowercase string, and because of how UnionType::isSuperTypeOfWithReason works
$result = IsSuperTypeOfResult::createNo()->or(...array_map(static fn (Type $innerType) => $innerType->isSuperTypeOfWithReason($otherType), $this->types));
if ($result->yes()) {
return $result;
}
we have a list with three reasons.
Is it ok for you @ondrejmirtes ?
0543a24 to
0087cd2
Compare
|
This pull request has been marked as ready for review. |
|
Not sure it's a satisfying solution |
|
There are conflicts now. |
|
Also - maybe base this on 2.1.x now. |
2ed4fb7 to
8ee29a9
Compare
c9618d9 to
944d18b
Compare
944d18b to
e52f144
Compare
It stopped working on 2.1.x when I rebased for the case because:
It seems like The issue is that when using I dunno if you see a fix/solution and/or if you're still interested in a way by this PR since it might have some inconsistency between when a reason is given and when it's not given @ondrejmirtes ? |
Closes phpstan/phpstan#11799