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
PrefixAllGlobals + ValidFunctionName: ignore deprecated methods by design #1806
PrefixAllGlobals + ValidFunctionName: ignore deprecated methods by design #1806
Conversation
This new function: * Tries to find a function docblock, if it exists. * If found, checks if the docblock contains at least one `@deprecated` tag. Returns boolean true/false. Note: this method is `static` to allow the `ValidFunctionName` sniff which extends an upstream sniff to use the method as well.
Check the function docblock for a `@deprecated` tag and if found, bow out. Includes unit tests. Fixes 1797
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.
LGTM.
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.
Left some minor comments 🙂
677171a
to
d5640f8
Compare
Check the function docblock for a `@deprecated` tag and if found, bow out. Includes unit tests. Fixes 1797 Note: the same should probably also be done for classes/interfaces/traits/constants marked as deprecated, but that's for another PR.
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.
Looks good 👍
Sniff: add new
is_function_deprecated()
utility functionThis new function:
@deprecated
tag.Returns boolean true/false.
Note: this method is
static
to allow theValidFunctionName
sniff which extends an upstream sniff to use the method as well.ValidFunctionName: ignore deprecated functions
Check the function docblock for a
@deprecated
tag and if found, bow out.Includes unit tests.
PrefixAllGlobals: ignore deprecated functions
Check the function docblock for a
@deprecated
tag and if found, bow out.Includes unit tests.
Note: the same should probably also be done for classes/interfaces/traits/constants marked as deprecated, but that's for another PR.
Fixes #1797