Skip to content

Commit

Permalink
bug #6070 Fix cache warmer for empty controllers (javiereguiluz)
Browse files Browse the repository at this point in the history
This PR was merged into the 4.x branch.

Discussion
----------

Fix cache warmer for empty controllers

Commits
-------

c880842 Fix cache warmer for empty controllers
  • Loading branch information
javiereguiluz committed Dec 26, 2023
2 parents c01186d + c880842 commit 5fa1b0c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Cache/CacheWarmer.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ public function warmUp(string $cacheDir, ?string $buildDir = null): array
}

$controller = u($controller);
if ($controller->isEmpty()) {
// this happens e.g. when using 'lexik/jwt-authentication-bundle', which defines an empty controller
continue;
}

if (!$controller->endsWith('::index') && !$controller->endsWith('::__invoke')) {
continue;
}
Expand Down

0 comments on commit 5fa1b0c

Please sign in to comment.