Skip to content

Commit 5f73b5f

Browse files
committed
Fix return type if no routes are defined
1 parent f54179a commit 5f73b5f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Providers/LaravelCaffeineService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ private function middlewareGroupExists(string $group) : bool
3535
$routes = collect(app('router')->getRoutes()->getRoutes());
3636

3737
return $routes->reduce(function ($carry, $route) use ($group) {
38-
$carry = $carry ?? false;
38+
$carry = ($carry ?? false) ?: false;
3939
$actions = (array) $route->getAction();
4040

4141
if (array_key_exists('middleware', $actions)
@@ -45,6 +45,6 @@ private function middlewareGroupExists(string $group) : bool
4545
}
4646

4747
return $carry;
48-
});
48+
}) ?? false;
4949
}
5050
}

0 commit comments

Comments
 (0)