-
Notifications
You must be signed in to change notification settings - Fork 20
Show deprecation text in the error message #2
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
Comments
I took a look at the code. It seems we need to change PHPStan\PhpDoc\PhpDocNodeResolver to let it store the deprecation text. |
Hi, this isn’t part of any standard, I don’t think the text has to be
included in the error message.
On Thu, 15 Nov 2018 at 05:49, Wenzheng Jiang ***@***.***> wrote:
I took a look at the code. It seems we need to change
PHPStan\PhpDoc\PhpDocNodeResolver
<https://github.com/phpstan/phpstan/blob/master/src/PhpDoc/ResolvedPhpDocBlock.php>
to let it store the deprecation text.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAGZuN5voZ2bUMg2nty2r2trKyeDXV4_ks5uvPJwgaJpZM4YfE-F>
.
--
Ondřej Mirtes
|
+1, this would be very useful. It is documented as part of the FIG standards (https://github.com/php-fig/fig-standards/blob/master/proposed/phpdoc-tags.md#55-deprecated) |
+1 for display deprecation info. Thanks @joshuaspence for pointing to PHPFIG. At least this should be added to the error message. |
We're using this for the Drupal 9 clean up of deprecated code. Having the deprecation message available would be great. Often times the message says when a method will be removed. So you could ignore certain deprecations (ie not Symfony 4.4 but anything else) |
The error message says what’s deprecated so you can put it to ignoreErrors,
right?
On Thu, 7 Mar 2019 at 02:22, Matt Glaman ***@***.***> wrote:
We're using this for the Drupal 9 clean up of deprecated code. Having the
deprecation message available would be great. Often times the message says
when a method will be removed. So you could ignore certain deprecations (ie
not Symfony 4.4 but anything else)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAGZuNY_Zq7maOCFLLnGDHMjnz7_JFXeks5vUGnHgaJpZM4YfE-F>
.
--
Ondřej Mirtes
|
Filtering out Here's what I have setup to help triage deprecations for Drupal core using my phpstan-junit formatter. Example report: https://deprecationbot.glamanate.com/job/core_aggregator/lastBuild/testReport/ It would be nice to include the deprecation message which includes how to fix the problem. This is really helpful at a code sprint. PHPStan error:
Message:
|
@ondrejmirtes for what it is worth, I am totally willing to own and contribute this. I just want to have your 👍 before venturing down the road. |
@mglaman Of course :) I need to give you a little bit of guidance on how to do it. Check out You have to create
Send a PR with this change to phpstan/phpstan. Once accepted, you can modify all the rules here in phpstan-deprecation-rules to output the description where available. Let me know if you have any questions. |
@ondrejmirtes thank you for the instructions! I will give this some time over the next week. |
This is now getting closer to being ready :) |
The parent PR has merged :) Now this can be worked |
Already doing that :) |
😮 beating me to the punch 😄 |
Implemented in 5685fe4, released as 0.11.2. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
When we deprecate a function or method, we also document the replacement to use. For example,
Currently when
foo
is used in the code, this rule only saysfoo
is deprecated.It would be very useful if it shows the deprecation text
Use bar instead
in the message as well.The text was updated successfully, but these errors were encountered: