isCsrfTokenValid() replace string by ?string

This commit is contained in:
Gaylord Poillon 2018-02-09 14:55:34 +01:00 committed by Nicolas Grekas
parent 99c5b77319
commit 37fbbca086
1 changed files with 3 additions and 3 deletions

View File

@ -370,12 +370,12 @@ trait ControllerTrait
/**
* Checks the validity of a CSRF token.
*
* @param string $id The id used when generating the token
* @param string $token The actual token sent with the request that should be validated
* @param string $id The id used when generating the token
* @param string|null $token The actual token sent with the request that should be validated
*
* @final since version 3.4
*/
protected function isCsrfTokenValid(string $id, string $token): bool
protected function isCsrfTokenValid(string $id, ?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".');