1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 06:42:41 +01:00

Improve the robustness of the "alias function" linter rule

Summary: Improve the `ArcanistXHPASTLinter::LINT_ALIAS_FUNCTION` linter rule. Currently this rule does not correctly handle alias functions which are not strictly lowercase.

Test Plan: Added a test case.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D12921
This commit is contained in:
Joshua Spence 2015-05-20 08:36:12 +10:00
parent 80691e0a66
commit 9444072e21
2 changed files with 4 additions and 1 deletions

View file

@ -4133,7 +4133,7 @@ final class ArcanistXHPASTLinter extends ArcanistBaseXHPASTLinter {
$function_name,
self::LINT_ALIAS_FUNCTION,
pht('Alias functions should be avoided.'),
$aliases[$function_name->getConcreteString()]);
$aliases[phutil_utf8_strtolower($function_name->getConcreteString())]);
}
}

View file

@ -3,12 +3,15 @@
$x = array();
sizeof($x);
die();
sizeOf($x);
~~~~~~~~~~
advice:4:1
advice:5:1
advice:6:1
~~~~~~~~~~
<?php
$x = array();
count($x);
exit();
count($x);