/** * @param $token * @return bool */ public function isTokenValid(CsrfToken $token) { if (!$this->storage->hasToken($token->getId())) { return false; } return $this->storage->getToken($token->getId()) == $token->getValue(); }