Skip to content

Commit d432e01

Browse files
committed
bug #4749 TokensAnalyze::isUnaryPredecessorOperator fix for CT::T_ARRAY_INDEX_C… (SpacePossum)
This PR was merged into the 2.15 branch. Discussion ---------- TokensAnalyze::isUnaryPredecessorOperator fix for CT::T_ARRAY_INDEX_C… …URLY_BRACE_CLOSE Commits ------- b9ae354 TokensAnalyze::isUnaryPredecessorOperator fix for CT::T_ARRAY_INDEX_CURLY_BRACE_CLOSE
2 parents 0ca79a2 + b9ae354 commit d432e01

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)