Page MenuHomePhabricator

Add PHPCS rule to autofix some aliased PHP function names for consistency
Closed, ResolvedPublic

Description

http://php.net/manual/en/aliases.php

For T173175 we decided upon is_int over is_integer. There's a lot more of these, and we should figure out which ones to autofix.

Event Timeline

Krinkle renamed this task from Have PHPCS autofix some aliases to the more commonly used functions to Add PHPCS rule to autofix some aliased PHP function names for consistency.Dec 27 2017, 9:10 PM
Krinkle moved this task from Untriaged to Accepted rule changes on the MediaWiki-Codesniffer board.

Change 402581 had a related patch set uploaded (by Umherirrender; owner: Umherirrender):
[mediawiki/tools/codesniffer@master] Expand sniff to replace some php aliases with main function

https://gerrit.wikimedia.org/r/402581

Change 402581 merged by jenkins-bot:
[mediawiki/tools/codesniffer@master] Expand sniff to replace some php aliases with main function

https://gerrit.wikimedia.org/r/402581

Umherirrender edited subscribers, added: Umherirrender; removed: gerritbot.

Added:

  • is_writeable => is_writable
  • join => implode
  • key_exists => array_key_exists
  • pos => current
  • sizeof => count

There are still some on the list under the url.

I am not sure, if it makes sense for the is_long, is_double and so on to be part of the sniff.

Feel free to close, if all is done or upload a follow up.

Legoktm assigned this task to Umherirrender.

I think this is fine for now - we can add more as they come up.