Page MenuHomePhabricator

D13633.id.diff
No OneTemporary

D13633.id.diff

diff --git a/src/lint/linter/__tests__/xhpast/creative-brace-use.lint-test b/src/lint/linter/__tests__/xhpast/creative-brace-use.lint-test
--- a/src/lint/linter/__tests__/xhpast/creative-brace-use.lint-test
+++ b/src/lint/linter/__tests__/xhpast/creative-brace-use.lint-test
@@ -35,6 +35,8 @@
else if ($y) {}
else {}
+if ($x) {}else{}
+
declare(ticks = 1);
~~~~~~~~~~
advice:3:14
@@ -52,6 +54,7 @@
warning:32:4
warning:34:11
warning:35:16
+warning:38:11
~~~~~~~~~~
<?php
@@ -77,4 +80,6 @@
if ($x) {} else if ($y) {} else {}
+if ($x) {} else{}
+
declare(ticks = 1);
diff --git a/src/lint/linter/xhpast/rules/ArcanistBraceFormattingXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistBraceFormattingXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistBraceFormattingXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistBraceFormattingXHPASTLinterRule.php
@@ -20,6 +20,7 @@
continue;
}
list($before, $after) = $list->getSurroundingNonsemanticTokens();
+
if (!$before) {
$first = head($tokens);
@@ -39,6 +40,7 @@
' '.$first->getValue());
} else if (count($before) === 1) {
$before = reset($before);
+
if ($before->getValue() !== ' ') {
$this->raiseLintAtToken(
$before,
@@ -78,7 +80,7 @@
}
list($before, $after) = $list->getSurroundingNonsemanticTokens();
if (!$before) {
- $first = last($tokens);
+ $first = head($tokens);
$this->raiseLintAtToken(
$first,

File Metadata

Mime Type
text/plain
Expires
Wed, Apr 2, 8:37 PM (1 d, 23 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7626391
Default Alt Text
D13633.id.diff (1 KB)

Event Timeline