-
Notifications
You must be signed in to change notification settings - Fork 473
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
Added ImplodeFunctionRule #679
Conversation
Build error is unrelated |
…into implode-array
return []; | ||
} | ||
|
||
if ($arrayType->getIterableValueType()->toString() instanceof ErrorType) { |
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.
We should also employ RuleLevelHelper::findTypeToCheck so that partially-wrong unions aren't reported until level 7.
Ther are many usages of that method, look through the codebase.
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.
adjusted. seems to work. does this require some kind of unit-test?
I am not sure yet, which case this new logic supports, which the previous didn't.
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.
Check out LevelsIntegrationTest, add something in acceptTypes.php, and re-run this test case. The JSON snapshots will be updated.
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.
thx, I guess it works now.
Thank you! |
closes phpstan/phpstan#5596