From b189b594d20c758ae9389ad93b4b8d74cfa82aef Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Wed, 11 Jun 2014 05:39:51 -0700 Subject: [PATCH] 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 >> 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 >> 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 --- src/lint/linter/ArcanistXHPASTLinter.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lint/linter/ArcanistXHPASTLinter.php b/src/lint/linter/ArcanistXHPASTLinter.php index 2bd9063d..178577bc 100644 --- a/src/lint/linter/ArcanistXHPASTLinter.php +++ b/src/lint/linter/ArcanistXHPASTLinter.php @@ -487,9 +487,9 @@ final class ArcanistXHPASTLinter extends ArcanistBaseXHPASTLinter { $classes = $root->selectDescendantsOfType('n_CLASS_NAME'); foreach ($classes as $node) { - $name = strtolower($node->getConcreteString()); - $version = idx($compat_info['interfaces'], $name); - $version = idx($compat_info['classes'], $name, $version); + $name = $node->getConcreteString(); + $version = idx($compat_info['interfaces'], strtolower($name)); + $version = idx($compat_info['classes'], strtolower($name), $version); if ($version && version_compare($version['min'], $required, '>')) { $this->raiseLintAtNode( $node,