From 8547a2592877993480c4f4ed853ae1b6a76d5b6f Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Wed, 8 Oct 2014 09:26:36 +1100 Subject: [PATCH] Fix `LINT_KEYWORD_CASING` for `class` keyword 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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lint/linter/ArcanistXHPASTLinter.php b/src/lint/linter/ArcanistXHPASTLinter.php index d3e7bb29..ecad30f5 100644 --- a/src/lint/linter/ArcanistXHPASTLinter.php +++ b/src/lint/linter/ArcanistXHPASTLinter.php @@ -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 -- 2.43.0