Report dead types even in multi-exception catch#2067
Closed
janedbal wants to merge 13 commits intophpstan:1.10.xfrom
Closed
Report dead types even in multi-exception catch#2067janedbal wants to merge 13 commits intophpstan:1.10.xfrom
janedbal wants to merge 13 commits intophpstan:1.10.xfrom
Conversation
89adae8 to
b42a687
Compare
Collaborator
|
This pull request has been marked as ready for review. |
janedbal
commented
Dec 13, 2022
b42a687 to
02aea0c
Compare
02aea0c to
29e3358
Compare
ondrejmirtes
requested changes
Feb 6, 2023
| closureDefaultParameterTypeRule: false | ||
| newRuleLevelHelper: false | ||
| instanceofType: false | ||
| detectDeadTypeInMultiCatch: true |
| { | ||
|
|
||
| public function __construct(private Catch_ $originalNode, private Type $caughtType, private Type $originalCaughtType) | ||
| public function __construct(private Catch_ $originalNode, private Type $unthrownType, private Type $originalCaughtType) |
Member
There was a problem hiding this comment.
We don't need to rename the parameter
| { | ||
| return array_merge( | ||
| parent::getAdditionalConfigFiles(), | ||
| !self::$detectDeadMultiCatch ? [__DIR__ . '/disable-detect-multi-catch.neon'] : [], |
Member
There was a problem hiding this comment.
Should be two separate test cases instead of switching the property. I haven't tested if this works, and the convention is to have two separate test cases... You can't be sure when getAdditionalConfigFiles will be called first and thus it can lead to unexpected behaviour.
Contributor
Author
|
Solved by #2399 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes phpstan/phpstan#7312