1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-26 00:32:41 +01:00

Fix handling of empty array index

Fix handling of empty array index by `ArcanistCurlyBraceArrayIndexXHPASTLinterRule`.

Auditors: epriestley
This commit is contained in:
Joshua Spence 2015-12-09 08:09:02 +11:00
parent d2e7785497
commit 0c8124a272
2 changed files with 7 additions and 0 deletions

View file

@ -19,6 +19,10 @@ final class ArcanistCurlyBraceArrayIndexXHPASTLinterRule
foreach ($index_accesses as $index_access) {
$tokens = $index_access->getChildByIndex(1)->getTokens();
if (!$tokens) {
continue;
}
$left_brace = head($tokens)->getPrevToken();
while (!$left_brace->isSemantic()) {
$left_brace = $left_brace->getPrevToken();

View file

@ -0,0 +1,3 @@
<?php
$x[] = 'value';
~~~~~~~~~~