Skip to content

Commit 49b2230

Browse files
Gaylord Poillonnicolas-grekas
authored andcommitted
isCsrfTokenValid() replace string by ?string
1 parent e60e0e4 commit 49b2230

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Controller/ControllerTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,12 +370,12 @@ protected function getUser()
370370
/**
371371
* Checks the validity of a CSRF token.
372372
*
373-
* @param string $id The id used when generating the token
374-
* @param string $token The actual token sent with the request that should be validated
373+
* @param string $id The id used when generating the token
374+
* @param string|null $token The actual token sent with the request that should be validated
375375
*
376376
* @final since version 3.4
377377
*/
378-
protected function isCsrfTokenValid(string $id, string $token): bool
378+
protected function isCsrfTokenValid(string $id, ?string $token): bool
379379
{
380380
if (!$this->container->has('security.csrf.token_manager')) {
381381
throw new \LogicException('CSRF protection is not enabled in your application. Enable it with the "csrf_protection" key in "config/packages/framework.yaml".');

0 commit comments

Comments
 (0)