WordPress / WordPress/WordPress-Coding-Standards
Warn about using alias functions
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 2.8k
- Forks
- 521
- Avg merge
- 5d 20h
- Merged PRs (30d)
- 1
Description
Is your feature request related to a problem?
Core recently replaced alias functions with their canonical counterparts in r49193:
Using the canonical function name for PHP functions is strongly recommended, as aliases may be deprecated or removed without (much) warning.
This replaces all uses of the following:
join()withimplode()
sizeof()withcount()
is_writeable()withis_writable()
doubleval()with a(float)cast
That hasn't been formalized in a sniff yet, so new instances can be added to the codebase, like in r49803 (see ticket:51056#comment:16.
Describe the solution you'd like
Calls to join(), sizeof(), is_writeable(), and doubleval() could produce a warning, and let ask devs to use the canonical counterpart.
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.
Research direction
No implementation files or tests are named; begin by locating the PHP_CodeSniffer sniff and its test fixtures that handle function calls. Done means calls to join(), sizeof(), is_writeable(), and doubleval() warn with their canonical alternatives, with coverage for each case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100