Skip to content

Commit

Permalink
Hotfix: detecting end of statement with PHP 7.4 fn closure
Browse files Browse the repository at this point in the history
  • Loading branch information
michalbundyra committed Dec 6, 2019
1 parent 2ecd8dc commit 6c2020a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Files/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -2356,10 +2356,12 @@ public function findEndOfStatement($start, $ignore=null)
&& ($i === $this->tokens[$i]['scope_opener']
|| $i === $this->tokens[$i]['scope_condition'])
) {
if ($i === $start
&& (isset(Util\Tokens::$scopeOpeners[$this->tokens[$i]['code']]) === true
|| $this->tokens[$i]['code'] === T_FN)
) {
if ($this->tokens[$i]['code'] === T_FN) {
$i = $this->tokens[$i]['scope_closer'] - 1;
continue;
}

if ($i === $start && isset(Util\Tokens::$scopeOpeners[$this->tokens[$i]['code']]) === true) {
return $this->tokens[$i]['scope_closer'];
}

Expand Down

0 comments on commit 6c2020a

Please sign in to comment.