Skip to content

Commit af91555

Browse files
committed
TASK: Remove obsolete sorting
after reflecting each class we sort classReflectionData which can also not be done instead :D but we still ensure that getAllClassNames returns all classes sorted. For using `array_diff` to get the $newClassNames we dont need sorting
1 parent 568381b commit af91555

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

Neos.Flow/Classes/Reflection/ReflectionService.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,9 @@ public function getAllClassNames(): array
261261
if (!$this->initialized) {
262262
$this->initialize();
263263
}
264-
265-
return array_keys($this->classReflectionData);
264+
$classNames = array_keys($this->classReflectionData);
265+
sort($classNames);
266+
return $classNames;
266267
}
267268

268269
/**
@@ -1074,8 +1075,6 @@ protected function reflectEmergedClasses(): void
10741075
// flatten nested array structure to a list of classes
10751076
$classNamesToReflect = array_merge(...array_values($this->availableClassNames));
10761077
$reflectedClassNames = array_keys($this->classReflectionData);
1077-
sort($classNamesToReflect);
1078-
sort($reflectedClassNames);
10791078
$newClassNames = array_diff($classNamesToReflect, $reflectedClassNames);
10801079
if ($newClassNames === []) {
10811080
return;
@@ -1192,10 +1191,6 @@ protected function reflectClass(string $className): void
11921191
foreach ($class->getMethods() as $method) {
11931192
$this->reflectClassMethod($className, $method);
11941193
}
1195-
// Sort reflection data so that the cache data is deterministic. This is
1196-
// important for comparisons when checking if classes have changed in a
1197-
// Development context.
1198-
ksort($this->classReflectionData);
11991194
$this->updatedReflectionData[$className] = true;
12001195
}
12011196

0 commit comments

Comments
 (0)