From 42e7b76dcda01853d15da5bebdc53f651513ab61 Mon Sep 17 00:00:00 2001 From: provokateurin Date: Fri, 15 Mar 2024 11:17:43 +0100 Subject: [PATCH] fix(routes): Correctly show warning about missing routes Signed-off-by: provokateurin --- generate-spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/generate-spec b/generate-spec index 3b5b1d5..0fc08b4 100755 --- a/generate-spec +++ b/generate-spec @@ -232,9 +232,6 @@ if ($capabilities == null && $publicCapabilities == null) { } $parsedRoutes = file_exists($appinfoDir . "/routes.php") ? Route::parseRoutes($appinfoDir . "/routes.php") : []; -if (count($parsedRoutes) == 0) { - Logger::warning("Routes", "No routes were loaded"); -} $controllers = []; $controllersDir = $sourceDir . "/Controller"; @@ -322,6 +319,10 @@ foreach ($controllers as $controllerName => $stmts) { } } +if (count($parsedRoutes) === 0) { + Logger::warning("Routes", "No routes were loaded"); +} + foreach ($parsedRoutes as $key => $value) { $isOCS = $key === "ocs"; $isIndex = $key === "routes";