mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-22 06:42:41 +01:00
Fix handling of empty array index
Fix handling of empty array index by `ArcanistCurlyBraceArrayIndexXHPASTLinterRule`. Auditors: epriestley
This commit is contained in:
parent
d2e7785497
commit
0c8124a272
2 changed files with 7 additions and 0 deletions
|
@ -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();
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
$x[] = 'value';
|
||||
~~~~~~~~~~
|
Loading…
Reference in a new issue