WordPress / WordPress/WordPress-Coding-Standards
Feature request: sniff to check that deprecation is properly handled
Open
@jrfnl is already working on this.
Since Oct 7, 2019.
Component: Core
Focus: WP interoperability
Type: Enhancement
- Dominant language
- PHP
- Stars
- 2.8k
- Forks
- 521
- Avg merge
- 5d 20h
- Merged PRs (30d)
- 1
Description
Just thinking.... maybe we should create a sniff that checks for calls to any of the deprecated....() functions and ensures that there is a @deprecated tag and visa versa ?
Some ideas for what the sniff should check:
- That a
_deprecated_...()function is called whenever a@deprecatedtag is encountered. - That a
@deprecatedtag is used whenever a_deprecated_...()function is called. - That the correct flavour of
_deprecated_...()function is called. - That the version nrs in the tag and the function parameter are in line.
- That the alternative listed in the tag and the function parameter are in line.
- That
__METHOD__is used for methods,__FUNCTION__for functions.
I propose the sniff be added to core based on all the issues related to this we've identified in PR #979.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.