Fix phpstan error courtesy of the laravel 11 upgrade (changed signatures and return types)

This commit is contained in:
James Cole
2024-04-02 15:40:33 +02:00
parent 87911c2438
commit a17bc7258f
73 changed files with 2772 additions and 2827 deletions

View File

@@ -69,7 +69,10 @@ class AppServiceProvider extends ServiceProvider
if ('' === $firstParam && str_contains($name, $route)) {
return true;
}
$params = Route::getCurrentRoute()->parameters() ?? [];
/** @var null|array $params */
$params = Route::getCurrentRoute()->parameters();
$params ??= [];
$objectType = $params['objectType'] ?? '';
if ($objectType === $firstParam && str_contains($name, $route)) {
return true;