diff --git a/src/Symfony/Component/Security/Csrf/CsrfTokenManager.php b/src/Symfony/Component/Security/Csrf/CsrfTokenManager.php index 450387a057899..84a0b330bb3f4 100644 --- a/src/Symfony/Component/Security/Csrf/CsrfTokenManager.php +++ b/src/Symfony/Component/Security/Csrf/CsrfTokenManager.php @@ -66,7 +66,7 @@ public function __construct(TokenGeneratorInterface $generator = null, TokenStor /** * {@inheritdoc} */ - public function getToken($tokenId) + public function getToken(string $tokenId) { $namespacedId = $this->getNamespace().$tokenId; if ($this->storage->hasToken($namespacedId)) { @@ -83,7 +83,7 @@ public function getToken($tokenId) /** * {@inheritdoc} */ - public function refreshToken($tokenId) + public function refreshToken(string $tokenId) { $namespacedId = $this->getNamespace().$tokenId; $value = $this->generator->generateToken(); @@ -96,7 +96,7 @@ public function refreshToken($tokenId) /** * {@inheritdoc} */ - public function removeToken($tokenId) + public function removeToken(string $tokenId) { return $this->storage->removeToken($this->getNamespace().$tokenId); } diff --git a/src/Symfony/Component/Security/Csrf/CsrfTokenManagerInterface.php b/src/Symfony/Component/Security/Csrf/CsrfTokenManagerInterface.php index a29c04fa7ab6f..588090cd1d28c 100644 --- a/src/Symfony/Component/Security/Csrf/CsrfTokenManagerInterface.php +++ b/src/Symfony/Component/Security/Csrf/CsrfTokenManagerInterface.php @@ -30,7 +30,7 @@ interface CsrfTokenManagerInterface * * @return CsrfToken The CSRF token */ - public function getToken($tokenId); + public function getToken(string $tokenId); /** * Generates a new token value for the given ID. @@ -44,7 +44,7 @@ public function getToken($tokenId); * * @return CsrfToken The CSRF token */ - public function refreshToken($tokenId); + public function refreshToken(string $tokenId); /** * Invalidates the CSRF token with the given ID, if one exists. @@ -54,7 +54,7 @@ public function refreshToken($tokenId); * @return string|null Returns the removed token value if one existed, NULL * otherwise */ - public function removeToken($tokenId); + public function removeToken(string $tokenId); /** * Returns whether the given CSRF token is valid.