Add support for @phpstan-throws#291
Closed
VincentLanglet wants to merge 1 commit intophpstan:masterfrom
Closed
Conversation
ondrejmirtes
requested changes
Aug 3, 2020
Member
ondrejmirtes
left a comment
There was a problem hiding this comment.
- Please fix the build. PHP 8 failures come from master and are fine, but your code contains errors.
- I think we should choose a different strategy - if there are @phpstan-throws tags, @throws tags should be skipped. That's for example what resolveVarTags does.
- There are no tests. I'd appreciate test for the change in InvalidPHPStanDocTagRule.php , and also something to demonstrate that the change in PhpDocNodeResolver does something at all. This is where it's currently tested: https://github.com/phpstan/phpstan-src/blob/02f4d4a0e09ddf9b6f30b022fc5357327cc0843d/tests/PHPStan/Reflection/Annotations/ThrowsAnnotationsTest.php
c8513e7 to
a0c6650
Compare
Contributor
Author
|
I made some updates, but I need phpstan/phpdoc-parser#51 first @ondrejmirtes :) |
a0c6650 to
c701b22
Compare
ondrejmirtes
requested changes
Aug 3, 2020
Member
ondrejmirtes
left a comment
There was a problem hiding this comment.
Please also bump phpdoc-parser in composer.json to 0.4.9 :)
src/PhpDoc/PhpDocNodeResolver.php
Outdated
Member
There was a problem hiding this comment.
This should be reversed - in case of both @throws and @phpstan-throws being present, @phpstan-throws should win. Also please add a test for this situation.
c701b22 to
01cbe49
Compare
Contributor
Author
|
Should be ok now @ondrejmirtes |
Member
|
Could you forcepush again? The build seems broken. |
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.
Related to phpstan/phpstan#3695 (comment)
@phpstan-throws voidcan avoid conflict with psalm/phan.