diff --git a/autoload.php b/autoload.php index c295b2ea75..e61c472fb1 100644 --- a/autoload.php +++ b/autoload.php @@ -210,7 +210,7 @@ public static function determineLoadedClass($classesBeforeLoad, $classesAfterLoa // That way, at the end, only the "main" class just included will remain. $newClasses = array_reduce( $newClasses, - function ($remaining, $current) { + static function ($remaining, $current) { return array_diff($remaining, class_parents($current)); }, $newClasses diff --git a/src/Reports/Summary.php b/src/Reports/Summary.php index 14692cfeda..c76e4bc2e5 100644 --- a/src/Reports/Summary.php +++ b/src/Reports/Summary.php @@ -97,7 +97,7 @@ public function generate( uksort( $reportFiles, - function ($keyA, $keyB) { + static function ($keyA, $keyB) { $pathPartsA = explode(DIRECTORY_SEPARATOR, $keyA); $pathPartsB = explode(DIRECTORY_SEPARATOR, $keyB); diff --git a/src/Util/Cache.php b/src/Util/Cache.php index 9d8d35d0b2..0146f4cdce 100644 --- a/src/Util/Cache.php +++ b/src/Util/Cache.php @@ -107,7 +107,7 @@ public static function load(Ruleset $ruleset, Config $config) ); $filter = new RecursiveCallbackFilterIterator( $di, - function ($file, $key, $iterator) { + static function ($file, $key, $iterator) { // Skip non-php files. $filename = $file->getFilename(); if ($file->isFile() === true && substr($filename, -4) !== '.php') {