-
-
Notifications
You must be signed in to change notification settings - Fork 862
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
Support messages on the deprecated PhpDoc tag #1983
Conversation
6b325ac
to
1b72d7f
Compare
1b72d7f
to
5f0c8ad
Compare
I think this is an error due to |
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.
Please also bump version cache in TypeNodeResolverExtension. There's also a high probability of conflicts with #1980 so the second PR merged will have to resolve them. /cc @marcospassos
The implementations should look almost identical so please check each other's PRs :) #1980 is missing populating all the reflection classes with the value so that should be added there.
@ondrejmirtes double checking the cache key bump should be in
|
e0476dc
to
79faab0
Compare
79faab0
to
0b48bf2
Compare
I've fixed the conflict with |
47f2e12
to
cb6b6aa
Compare
This failure is blowing my mind. It doesn't fail locally (macOS, 7.3) but does on Travis
The only thing I can find that would cause this is ResolvedPhpDocBlock:
|
cb6b6aa
to
e5bc4f7
Compare
🤦🏼♂️The error was due to TravisCI caches. @ondrejmirtes this should be ready for review again. If you purge the PR caches I can revert 93b7b77, unless you don't mind the double increment. |
Really excited about this! This will help people resolve deprecations so much! |
93b7b77
to
ea69061
Compare
I added two commits: * fc5ed56 - I hope my intention is clear About the second commit - it seemed very peculiar to me that you introduced some changes to phpdoc-parser that are not used here. So I tried to take advantage of them by releasing new version of phpdoc-parser, but something broke - multiline descriptions are now parsed wrong way. Can you look into it? Thanks :) |
fc5ed56 makes sense, I realized the code became fragmented in my handling. This seems to solidify it. For the second commit: I wasn't sure if that PR would land, or how to uptake it :) I was going to try integrating it tonight but you beat me! I'll review this tonight. |
This makes more sense after reading it again. The deprecation rules should provide the format of "Foo is deprecated {description"
I'm digging in to see why the following case fails. I'm guessing I missed a scenario in the phpdoc-parser, but I will validate that.
|
It's my code in this PR, started jumping around too much. |
@@ -212,6 +217,45 @@ private function resolveThrowsTags(PhpDocNode $phpDocNode, NameScope $nameScope) | |||
return new ThrowsTag(TypeCombinator::union(...$types)); | |||
} | |||
|
|||
private function resolveDeprecatedTag(PhpDocNode $phpDocNode, NameScope $nameScope): ?\PHPStan\PhpDoc\Tag\DeprecatedTag | |||
{ | |||
foreach ($phpDocNode->getDeprecatedTagValues() as $deprecatedTagValue) { |
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.
🤔 @ondrejmirtes so this whole block of code "reassembles" multiple line deprecation comments. Should that go here or in the phpdoc-parser library? It didn't occur to me previously. But now that we have the code in phpdoc-parser it popped up in my head.
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.
Try making it part of phpdoc-parser
so that the node description field already has the text.
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.
Thanks, I will do that
a4b5f35
to
042c7dc
Compare
…ption returns only additional information, not general message
042c7dc
to
7471db7
Compare
Let's see if this builds :) |
7471db7
to
59368c4
Compare
59368c4
to
77b355f
Compare
🎉 |
🤩thank you! I will move over to the deprecation rules extension! |
Don't worry, I'm already working on it. Want to release it tomorrow. |
Adds support for returning the descriptive messages behind
@deprecated
tags.In reference to phpstan/phpstan-deprecation-rules#2