Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Handle anonymous functions correctly.

  • Loading branch information...
commit 849380e37c4077088b35361fbfa7bc846cf73fe6 1 parent 122bfaa
@sebastianbergmann authored
Showing with 9 additions and 0 deletions.
  1. +9 −0 PHPUnit/Util/File.php
View
9 PHPUnit/Util/File.php
@@ -298,6 +298,15 @@ protected static function parseFile($filename)
break;
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;
$currentFunctionStartLine = $line;
Please sign in to comment.
Something went wrong with that request. Please try again.