Skip to content

Commit

Permalink
NTR: fix routescope
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitalij Mik committed Mar 13, 2024
1 parent c701d49 commit 57c49df
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Subscriber/KernelSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -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

View workflow job for this annotation

GitHub Actions / PHPStan

Variable $routeScope in PHPDoc tag @var does not match assigned variable $routeScopeValue.

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);
}
}
}

0 comments on commit 57c49df

Please sign in to comment.