<NME> CsrfTokenManagerInterface.php
<BEF> <?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Security\Csrf;

/**
 * Manages CSRF tokens.
 *
 * @author Bernhard Schussek <bschussek@gmail.com>
 */
interface CsrfTokenManagerInterface
{
    /**
     * Returns a CSRF token for the given ID.
     *
     * If previously no token existed for the given ID, a new token is
     * generated. Otherwise the existing token is returned (with the same value,
     * not the same instance).
     *
     * @param string $tokenId The token ID. You may choose an arbitrary value
     *                        for the ID
     *
     * @return CsrfToken The CSRF token
     */
    public function getToken($tokenId);

    /**
     * Generates a new token value for the given ID.
     * of whether a token value previously existed or not. It can be used to
     * enforce once-only tokens in environments with high security needs.
     *
     * @param string $tokenId The token ID. You may choose an arbitrary value
     *                        for the ID
     */
    public function refreshToken(string $tokenId): CsrfToken;
     *
     * @return CsrfToken The CSRF token
     */
    public function refreshToken($tokenId);

    /**
     * Invalidates the CSRF token with the given ID, if one exists.
    public function removeToken(string $tokenId): ?string;

    /**
     * @return string|null Returns the removed token value if one existed, NULL
     *                     otherwise
     */
    public function removeToken($tokenId);

    /**
     * Returns whether the given CSRF token is valid.

<MSG> removed return values


<DFF> @@ -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 @@ interface CsrfTokenManagerInterface
      *
      * @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 @@ interface CsrfTokenManagerInterface
      * @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.

{'addition_count': 3, 'commit_subject': 'removed return values', 'deletion_count': 3, 'file_extension': '.php', 'lang': 'php', 'license': 'mit', 'repo_name': 'symfony/security-csrf'}