Skip to content

Commit 4f0b383

Browse files
authored
Merge pull request #1034 from PHPCSStandards/phpcs-4.0/modernize/use-static-closures
Modernize: static closures should be static
2 parents c341d74 + af3cfe2 commit 4f0b383

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

autoload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public static function determineLoadedClass($classesBeforeLoad, $classesAfterLoa
210210
// That way, at the end, only the "main" class just included will remain.
211211
$newClasses = array_reduce(
212212
$newClasses,
213-
function ($remaining, $current) {
213+
static function ($remaining, $current) {
214214
return array_diff($remaining, class_parents($current));
215215
},
216216
$newClasses

src/Reports/Summary.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function generate(
9797

9898
uksort(
9999
$reportFiles,
100-
function ($keyA, $keyB) {
100+
static function ($keyA, $keyB) {
101101
$pathPartsA = explode(DIRECTORY_SEPARATOR, $keyA);
102102
$pathPartsB = explode(DIRECTORY_SEPARATOR, $keyB);
103103

src/Util/Cache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public static function load(Ruleset $ruleset, Config $config)
107107
);
108108
$filter = new RecursiveCallbackFilterIterator(
109109
$di,
110-
function ($file, $key, $iterator) {
110+
static function ($file, $key, $iterator) {
111111
// Skip non-php files.
112112
$filename = $file->getFilename();
113113
if ($file->isFile() === true && substr($filename, -4) !== '.php') {

0 commit comments

Comments
 (0)