mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-22 14:52:40 +01:00
Present case of class and interface names.
Summary: Currently, class and interface names are converted to lowercase when comparing minimum and maximum versions. This is necessary in order to compare with the data from `php_compat_info.json` but causes the lint message to be slightly misleading. Test Plan: Linted a test file. **Before** ``` Error (XHP31) Use Of PHP 5.3 Features This codebase targets PHP 5.2.3, but `iterator` was not introduced until PHP 5.3.0. 1 <?php 2 >>> 3 final class FooBar implements Iterator {} ``` **After** ``` Error (XHP31) Use Of PHP 5.3 Features This codebase targets PHP 5.2.3, but `Iterator` was not introduced until PHP 5.3.0. 1 <?php 2 >>> 3 final class FooBar implements Iterator {} ``` Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D9471
This commit is contained in:
parent
4c06d1b9e3
commit
b189b594d2
1 changed files with 3 additions and 3 deletions
|
@ -487,9 +487,9 @@ final class ArcanistXHPASTLinter extends ArcanistBaseXHPASTLinter {
|
||||||
|
|
||||||
$classes = $root->selectDescendantsOfType('n_CLASS_NAME');
|
$classes = $root->selectDescendantsOfType('n_CLASS_NAME');
|
||||||
foreach ($classes as $node) {
|
foreach ($classes as $node) {
|
||||||
$name = strtolower($node->getConcreteString());
|
$name = $node->getConcreteString();
|
||||||
$version = idx($compat_info['interfaces'], $name);
|
$version = idx($compat_info['interfaces'], strtolower($name));
|
||||||
$version = idx($compat_info['classes'], $name, $version);
|
$version = idx($compat_info['classes'], strtolower($name), $version);
|
||||||
if ($version && version_compare($version['min'], $required, '>')) {
|
if ($version && version_compare($version['min'], $required, '>')) {
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$node,
|
$node,
|
||||||
|
|
Loading…
Reference in a new issue