Skip to content

Commit

Permalink
Fixed bug #1971 : Short array list syntax not correctly tokenized if …
Browse files Browse the repository at this point in the history
…short array is the first content in a file
  • Loading branch information
gsherwood committed Mar 27, 2018
1 parent 9421d7c commit fe52812
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
-- Thanks to Juliette Reinders Folmer for the patch
- Fixed bug #1963 : Squiz.Scope.MemberVarScope does not work for multiline member declaration
-- Thanks to Juliette Reinders Folmer for the patch
- Fixed bug #1971 : Short array list syntax not correctly tokenized if short array is the first content in a file
</notes>
<contents>
<dir name="/">
Expand Down
2 changes: 1 addition & 1 deletion src/Tokenizers/PHP.php
Original file line number Diff line number Diff line change
Expand Up @@ -1549,7 +1549,7 @@ protected function processAdditional()
T_CONSTANT_ENCAPSED_STRING => T_CONSTANT_ENCAPSED_STRING,
];

for ($x = ($i - 1); $x > 0; $x--) {
for ($x = ($i - 1); $x >= 0; $x--) {
// If we hit a scope opener, the statement has ended
// without finding anything, so it's probably an array
// using PHP 7.1 short list syntax.
Expand Down

0 comments on commit fe52812

Please sign in to comment.