public function isTokenValid(CsrfToken $token) {

		$tokenId = $token->getId();

		if (!$this->storage->hasToken($tokenId)) {
			return FALSE;
		}
	
		return hash_equals($this->storage->getToken($tokenId)->getValue(), $token->getValue());

	}
public function isTokenValid(CsrfToken $token) {

		$tokenId = $token->getId();

		if (!$this->storage->hasToken($tokenId)) {
			return FALSE;
		}
	
		return hash_equals($this->storage->getToken($tokenId)->getValue(), $token->getValue());

	}
public function isTokenValid ( CsrfToken $ token ) { $ tokenId = $ token -> getId ( ) ; if ( ! $ this -> storage -> hasToken ( $ tokenId ) ) { return FALSE ; } return hash_equals ( $ this -> storage -> getToken ( $ tokenId ) -> getValue ( ) , $ token -> getValue ( ) ) ; }
check whether the given CSRF token is valid
returns TRUE if the token is valid, FALSE otherwise

@param CsrfToken $token
@return bool
check whether the given CSRF token is valid returns TRUE if the token is valid FALSE otherwise