Skip to content

Commit 00e69ca

Browse files
committed
Fixed bug #563 - new code to detect closures was being confused by abstract functions
1 parent 76853c5 commit 00e69ca

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

CodeSniffer/File.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2067,7 +2067,9 @@ private static function _recurseScopeMap(
20672067
continue;
20682068
}
20692069

2070-
if ($tokenType === T_FUNCTION) {
2070+
if ($tokenType === T_FUNCTION
2071+
&& $tokens[$stackPtr]['code'] !== T_FUNCTION
2072+
) {
20712073
// Probably a closure, so process it manually.
20722074
if (PHP_CODESNIFFER_VERBOSITY > 1) {
20732075
$type = $tokens[$stackPtr]['type'];

0 commit comments

Comments
 (0)