WordPress / WordPress/WordPress-Coding-Standards

Feature request: sniff to check that deprecation is properly handled

Open
#993 3 comments 3 reactions 1 assignee View on GitHub

@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

In https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/pull/979#issuecomment-310235942 :

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 @deprecated tag is encountered.
  • That a @deprecated tag 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.