From: Joshua Spence Date: Fri, 17 Jul 2015 06:40:45 +0000 (+1000) Subject: Fix brace formatting linter rule X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=58302432cc5fdc3c191ef20bf104b6f803b6731d;p=arcanist.git Fix brace formatting linter rule Summary: Fixes T8847. Test Plan: Ran `arc lint` on a test file: ```lang=php getSurroundingNonsemanticTokens(); + if (!$before) { $first = head($tokens); @@ -39,6 +40,7 @@ final class ArcanistBraceFormattingXHPASTLinterRule ' '.$first->getValue()); } else if (count($before) === 1) { $before = reset($before); + if ($before->getValue() !== ' ') { $this->raiseLintAtToken( $before, @@ -78,7 +80,7 @@ final class ArcanistBraceFormattingXHPASTLinterRule } list($before, $after) = $list->getSurroundingNonsemanticTokens(); if (!$before) { - $first = last($tokens); + $first = head($tokens); $this->raiseLintAtToken( $first,