Skip to content

Commit cb5de61

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 416181b commit cb5de61

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
@@ -265,8 +265,9 @@ public function getAllClassNames(): array
265265
if (!$this->initialized) {
266266
$this->initialize();
267267
}
268-
269-
return array_keys($this->classReflectionData);
268+
$classNames = array_keys($this->classReflectionData);
269+
sort($classNames);
270+
return $classNames;
270271
}
271272

272273
/**
@@ -1093,8 +1094,6 @@ protected function reflectEmergedClasses(): void
10931094
}
10941095
$classNamesToReflect = array_merge([], ...$availableClassnames);
10951096
$reflectedClassNames = array_keys($this->classReflectionData);
1096-
sort($classNamesToReflect);
1097-
sort($reflectedClassNames);
10981097
$newClassNames = array_diff($classNamesToReflect, $reflectedClassNames);
10991098
if ($newClassNames === []) {
11001099
return;
@@ -1213,10 +1212,6 @@ protected function reflectClass(string $className): void
12131212
foreach ($class->getMethods() as $method) {
12141213
$this->reflectClassMethod($className, $method);
12151214
}
1216-
// Sort reflection data so that the cache data is deterministic. This is
1217-
// important for comparisons when checking if classes have changed in a
1218-
// Development context.
1219-
ksort($this->classReflectionData);
12201215
$this->updatedReflectionData[$className] = true;
12211216
}
12221217

0 commit comments

Comments
 (0)