Skip to content

Commit b9ae354

Browse files
committed
TokensAnalyze::isUnaryPredecessorOperator fix for CT::T_ARRAY_INDEX_CURLY_BRACE_CLOSE
1 parent 0ca79a2 commit b9ae354

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/Tokenizer/TokensAnalyzer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ public function isUnaryPredecessorOperator($index)
431431
'"',
432432
'`',
433433
[CT::T_ARRAY_SQUARE_BRACE_CLOSE],
434+
[CT::T_ARRAY_INDEX_CURLY_BRACE_CLOSE],
434435
[CT::T_DYNAMIC_PROP_BRACE_CLOSE],
435436
[CT::T_DYNAMIC_VAR_BRACE_CLOSE],
436437
[T_CLASS_C],

tests/Tokenizer/TokensAnalyzerTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,6 +1032,14 @@ public function testIsBinaryOperator($source, array $expected)
10321032
public function provideIsBinaryOperatorCases()
10331033
{
10341034
$cases = [
1035+
[
1036+
'<?php echo $a[1] + 1;',
1037+
[8 => true],
1038+
],
1039+
[
1040+
'<?php echo $a{1} + 1;',
1041+
[8 => true],
1042+
],
10351043
[
10361044
'<?php $a .= $b; ?>',
10371045
[3 => true],

0 commit comments

Comments
 (0)