Skip to content

Commit

Permalink
fix(routes): Correctly show warning about missing routes
Browse files Browse the repository at this point in the history
Signed-off-by: provokateurin <[email protected]>
  • Loading branch information
provokateurin committed Mar 15, 2024
1 parent 055ea76 commit 42e7b76
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions generate-spec
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down

0 comments on commit 42e7b76

Please sign in to comment.