Skip to content

Commit

Permalink
Handle anonymous functions correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Jan 1, 2010
1 parent 122bfaa commit 849380e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions PHPUnit/Util/File.php
Expand Up @@ -298,6 +298,15 @@ protected static function parseFile($filename)
break; break;


case T_FUNCTION: { case T_FUNCTION: {
if (!((is_array($tokens[$i+2]) &&
$tokens[$i+2][0] == T_STRING) ||
(is_string($tokens[$i+2]) &&
$tokens[$i+2] == '&' &&
is_array($tokens[$i+3]) &&
$tokens[$i+3][0] == T_STRING))) {
continue;
}

$currentBlock = T_FUNCTION; $currentBlock = T_FUNCTION;
$currentFunctionStartLine = $line; $currentFunctionStartLine = $line;


Expand Down

0 comments on commit 849380e

Please sign in to comment.