Skip to content

Commit

Permalink
Merge pull request #107 from nextcloud/fix/routes/warning
Browse files Browse the repository at this point in the history
fix(routes): Correctly show warning about missing routes
  • Loading branch information
nickvergessen authored Mar 15, 2024
2 parents 055ea76 + 42e7b76 commit 1d8b0ee
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 1d8b0ee

Please sign in to comment.