From b25bd41696f9d146e6d92721762aa6efd4deff74 Mon Sep 17 00:00:00 2001 From: provokateurin Date: Wed, 21 Feb 2024 11:39:26 +0100 Subject: [PATCH] fix: Load controllers in a deterministic order Signed-off-by: provokateurin --- generate-spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/generate-spec b/generate-spec index 4354ab9..3b5b1d5 100755 --- a/generate-spec +++ b/generate-spec @@ -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)); } }