]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Fix `LINT_KEYWORD_CASING` for `class` keyword
authorJoshua Spence <josh@joshuaspence.com>
Tue, 7 Oct 2014 22:26:36 +0000 (09:26 +1100)
committerJoshua Spence <josh@joshuaspence.com>
Tue, 7 Oct 2014 22:29:35 +0000 (09:29 +1100)
Summary: D10653 didn't quite cut it.

Test Plan: Tested on a real file.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D10656

src/lint/linter/ArcanistXHPASTLinter.php

index d3e7bb2992e29c5b1f58089f066044a5cf3cb423..ecad30f51a0f5033cd3ab99ecf7a1092b8ec2f49 100644 (file)
@@ -2553,6 +2553,11 @@ final class ArcanistXHPASTLinter extends ArcanistBaseXHPASTLinter {
       $keywords[] = head($invocation->getTokens());
     }
 
+    $class_declarations = $root->selectDescendantsOfType('n_CLASS_DECLARATION');
+    foreach ($class_declarations as $declaration) {
+      $keywords[] = head($declaration->getTokens());
+    }
+
     // NOTE: Although PHP generally allows arbitrary casing for all language
     // keywords, it's exceedingly rare for anyone to type, e.g., "CLASS" or
     // "cLaSs" in the wild. This list just attempts to cover unconventional