Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions Neos.Flow/Classes/Reflection/ReflectionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,9 @@ public function getAllClassNames(): array
if (!$this->initialized) {
$this->initialize();
}

return array_keys($this->classReflectionData);
$classNames = array_keys($this->classReflectionData);
sort($classNames);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as karsten wrote

Why the sorting? Is that the central replacement for the removed sort calls later on?

yes as the structure is not internally sorted anymore but getAllClassNames guaranteed A-Z order before i thought we should continue to do so.
On the other hand, getAllClassNames can be considered rather low level and is only used once so we can also put sorting on the callers site - maybe no sorting is needed for every usecase.

return $classNames;
}

/**
Expand Down Expand Up @@ -1093,8 +1094,6 @@ protected function reflectEmergedClasses(): void
}
$classNamesToReflect = array_merge([], ...$availableClassnames);
$reflectedClassNames = array_keys($this->classReflectionData);
sort($classNamesToReflect);
sort($reflectedClassNames);
$newClassNames = array_diff($classNamesToReflect, $reflectedClassNames);
if ($newClassNames === []) {
return;
Expand Down Expand Up @@ -1213,10 +1212,6 @@ protected function reflectClass(string $className): void
foreach ($class->getMethods() as $method) {
$this->reflectClassMethod($className, $method);
}
// Sort reflection data so that the cache data is deterministic. This is
// important for comparisons when checking if classes have changed in a
// Development context.
ksort($this->classReflectionData);
$this->updatedReflectionData[$className] = true;
}

Expand Down
Loading