Skip to content

Commit

Permalink
fix: Load controllers in a deterministic order
Browse files Browse the repository at this point in the history
Signed-off-by: provokateurin <[email protected]>
  • Loading branch information
provokateurin committed Feb 21, 2024
1 parent 7e39e24 commit b25bd41
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions generate-spec
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,17 @@ $controllers = [];
$controllersDir = $sourceDir . "/Controller";
if (file_exists($controllersDir)) {
$dir = new DirectoryIterator($controllersDir);
$controllerFiles = [];
foreach ($dir as $file) {
$filePath = $file->getPathname();
if (!str_ends_with($filePath, "Controller.php")) {
continue;
}
$controllerFiles[] = $filePath;
}
sort($controllerFiles);

foreach ($controllerFiles as $filePath) {
$controllers[basename($filePath, "Controller.php")] = $astParser->parse(file_get_contents($filePath));
}
}
Expand Down

0 comments on commit b25bd41

Please sign in to comment.