Give class template context to conditional checker#2241
Give class template context to conditional checker#2241ondrejmirtes merged 7 commits intophpstan:1.10.xfrom
Conversation
a68edf9 to
f7f7f40
Compare
|
This pull request has been marked as ready for review. |
f7f7f40 to
7c3e695
Compare
There was a problem hiding this comment.
it seems you are adding a new test-case here, but you did not analyze this file from any of the *Test classes.
you need to make sure that this file is analyzed from the correct *Test class - the one which is testing the rule which emits the error you are trying to fix
There was a problem hiding this comment.
- File name needs to be in
bug-8609.phpformat. - File needs to be analysed by tests/PHPStan/Rules/PhpDoc/MethodConditionalReturnTypeRuleTest.php.
ondrejmirtes
left a comment
There was a problem hiding this comment.
Additionally, we need to test that this actually works. A new file tested in NodeScopeResolverTest would be nice.
There was a problem hiding this comment.
union isn't the best operation for this. I suggest array_merge instead, like here:
phpstan-src/src/Analyser/NameScope.php
Lines 164 to 167 in b250a8b
There was a problem hiding this comment.
- File name needs to be in
bug-8609.phpformat. - File needs to be analysed by tests/PHPStan/Rules/PhpDoc/MethodConditionalReturnTypeRuleTest.php.
|
Finished it myself :) Thank you! |
This PR fixes bug reported here: phpstan/phpstan#8609