diff --git a/src/Symfony/Component/Security/Http/Attribute/IsGranted.php b/src/Symfony/Component/Security/Http/Attribute/IsGranted.php index 928babe261f24..2b4c2b532bc8d 100644 --- a/src/Symfony/Component/Security/Http/Attribute/IsGranted.php +++ b/src/Symfony/Component/Security/Http/Attribute/IsGranted.php @@ -15,7 +15,7 @@ * @author Ryan Weaver */ #[\Attribute(\Attribute::IS_REPEATABLE | \Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::TARGET_FUNCTION)] -class IsGranted +final class IsGranted { public function __construct( /** diff --git a/src/Symfony/Component/Security/Http/EventListener/IsGrantedAttributeListener.php b/src/Symfony/Component/Security/Http/EventListener/IsGrantedAttributeListener.php index 8fcc4b8313485..b15875fddad1c 100644 --- a/src/Symfony/Component/Security/Http/EventListener/IsGrantedAttributeListener.php +++ b/src/Symfony/Component/Security/Http/EventListener/IsGrantedAttributeListener.php @@ -17,6 +17,7 @@ use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface; use Symfony\Component\Security\Core\Exception\AccessDeniedException; +use Symfony\Component\Security\Core\Exception\RuntimeException; use Symfony\Component\Security\Http\Attribute\IsGranted; /** @@ -48,12 +49,12 @@ public function onKernelControllerArguments(ControllerArgumentsEvent $event) if (\is_array($subjectRef)) { foreach ($subjectRef as $ref) { if (!\array_key_exists($ref, $arguments)) { - throw new \RuntimeException(sprintf('Could not find the subject "%s" for the #[IsGranted] attribute. Try adding a "$%s" argument to your controller method.', $ref, $ref)); + throw new RuntimeException(sprintf('Could not find the subject "%s" for the #[IsGranted] attribute. Try adding a "$%s" argument to your controller method.', $ref, $ref)); } $subject[$ref] = $arguments[$ref]; } } elseif (!\array_key_exists($subjectRef, $arguments)) { - throw new \RuntimeException(sprintf('Could not find the subject "%s" for the #[IsGranted] attribute. Try adding a "$%s" argument to your controller method.', $subjectRef, $subjectRef)); + throw new RuntimeException(sprintf('Could not find the subject "%s" for the #[IsGranted] attribute. Try adding a "$%s" argument to your controller method.', $subjectRef, $subjectRef)); } else { $subject = $arguments[$subjectRef]; }