try { $session =
$this->container->
get('request_stack'
)->
getSession();
} catch (SessionNotFoundException
$e) { throw new \
LogicException('You cannot use the addFlash method if sessions are disabled. Enable them in "config/packages/framework.yaml".', 0,
$e);
} if (!
$session instanceof FlashBagAwareSessionInterface
) { trigger_deprecation('symfony/framework-bundle', '6.2', 'Calling "addFlash()" method when the session does not implement %s is deprecated.', FlashBagAwareSessionInterface::
class);
} $session->
getFlashBag()->
add($type,
$message);
} /**
* Checks if the attribute is granted against the current authentication token and optionally supplied subject.
*
* @throws \LogicException
*/
protected function isGranted(mixed
$attribute, mixed
$subject = null
): bool
{ if (!
$this->container->
has('security.authorization_checker'
)) { throw new \
LogicException('The SecurityBundle is not registered in your application. Try running "composer require symfony/security-bundle".'
);
}