protected function isCsrfTokenValid(string
$id, #[\SensitiveParameter] ?string $token): bool
{ if (!
$this->container->
has('security.csrf.token_manager'
)) { throw new \
LogicException('CSRF protection is not enabled in your application. Enable it with the "csrf_protection" key in "config/packages/framework.yaml".'
);
} return $this->container->
get('security.csrf.token_manager'
)->
isTokenValid(new CsrfToken($id,
$token));
} /**
* Adds a Link HTTP header to the current response.
*
* @see https://tools.ietf.org/html/rfc5988
*/
protected function addLink(Request
$request, LinkInterface
$link): void
{ if (!
class_exists(AddLinkHeaderListener::
class)) { throw new \
LogicException('You cannot use the "addLink" method if the WebLink component is not available. Try running "composer require symfony/web-link".'
);
}