]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Fix linter rule after XHPAST change
authorJoshua Spence <josh@joshuaspence.com>
Thu, 27 Aug 2015 12:08:49 +0000 (22:08 +1000)
committerJoshua Spence <josh@freelancer.com>
Thu, 27 Aug 2015 12:08:49 +0000 (22:08 +1000)
Summary: Depends on D13959.

Test Plan: Ran unit tests.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin

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

src/lint/linter/xhpast/rules/ArcanistPHPCompatibilityXHPASTLinterRule.php

index 5ee6f3fe77dbf5b8ab4e823e61a84c2757fc6a5c..e2f627a329edb500c105b8abd21712f6102573be 100644 (file)
@@ -327,7 +327,7 @@ final class ArcanistPHPCompatibilityXHPASTLinterRule
 
     $ternaries = $root->selectDescendantsOfType('n_TERNARY_EXPRESSION');
     foreach ($ternaries as $ternary) {
-      $yes = $ternary->getChildByIndex(1);
+      $yes = $ternary->getChildByIndex(2);
       if ($yes->getTypeName() === 'n_EMPTY') {
         $this->raiseLintAtNode(
           $ternary,