-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Vitalij Mik
committed
Mar 13, 2024
1 parent
c701d49
commit 57c49df
Showing
1 changed file
with
5 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,16 +23,16 @@ public function onModifyRouteScope(ControllerEvent $event): void | |
$attributes = $event->getRequest()->attributes; | ||
|
||
/** @var null|RouteScope|string $routeScope */ | ||
$routeScope = $attributes->get(PlatformRequest::ATTRIBUTE_ROUTE_SCOPE); | ||
$routeScopeValue = $attributes->get(PlatformRequest::ATTRIBUTE_ROUTE_SCOPE); | ||
Check failure on line 26 in src/Subscriber/KernelSubscriber.php GitHub Actions / PHPStan
|
||
|
||
if (is_string($routeScope)) { | ||
$routeData = [$routeScope]; | ||
if (is_string($routeScopeValue)) { | ||
$routeScope = [$routeScopeValue]; | ||
|
||
if (class_exists(RouteScope::class)) { | ||
$routeData = new RouteScope(['scopes' => [$routeScope]]); | ||
$routeScope = new RouteScope(['scopes' => [$routeScopeValue]]); | ||
} | ||
|
||
$attributes->set(PlatformRequest::ATTRIBUTE_ROUTE_SCOPE, $routeData); | ||
$attributes->set(PlatformRequest::ATTRIBUTE_ROUTE_SCOPE, $routeScope); | ||
} | ||
} | ||
} |