Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Closes #110

  • Loading branch information...
commit 3aa8c80eae0aaf88ca60553eac34b82cd856396a 1 parent dfc5626
@sebastianbergmann authored
Showing with 9 additions and 7 deletions.
  1. +9 −7 src/Analyser.php
View
16 src/Analyser.php
@@ -398,13 +398,15 @@ public function countFile($filename, $countTests)
case T_FUNCTION:
$currentBlock = T_FUNCTION;
- if (is_array($tokens[$i+2]) &&
- $tokens[$i+2][0] == T_STRING) {
- $functionName = $tokens[$i+2][1];
- } elseif ($tokens[$i+2] == '&' &&
- is_array($tokens[$i+3]) &&
- $tokens[$i+3][0] == T_STRING) {
- $functionName = $tokens[$i+3][1];
+ $next = $this->getNextNonWhitespaceTokenPos($tokens, $i);
+
+ if (!is_array($tokens[$next]) && $tokens[$next] == '&') {
+ $next = $this->getNextNonWhitespaceTokenPos($tokens, $next);
+ }
+
+ if (is_array($tokens[$next]) &&
+ $tokens[$next][0] == T_STRING) {
+ $functionName = $tokens[$next][1];
} else {
$currentBlock = 'anonymous function';
$functionName = 'anonymous function';
Please sign in to comment.
Something went wrong with that request. Please try again.