private function parseToken(Request $request) : ?Token
    {
        $cookies    = $request->getCookieParams();
        $cookieName = $this->defaultCookie->getName();

        if (! isset($cookies[$cookieName])) {
            return null;
        }

        try {
            $token = $this->tokenParser->parse($cookies[$cookieName]);
        } catch (\InvalidArgumentException $invalidToken) {
            return null;
        }

        if (! $token->validate(new ValidationData())) {
            return null;
        }

        return $token;
    }
private function parseToken(Request $request) : ?Token
    {
        $cookies    = $request->getCookieParams();
        $cookieName = $this->defaultCookie->getName();

        if (! isset($cookies[$cookieName])) {
            return null;
        }

        try {
            $token = $this->tokenParser->parse($cookies[$cookieName]);
        } catch (\InvalidArgumentException $invalidToken) {
            return null;
        }

        if (! $token->validate(new ValidationData())) {
            return null;
        }

        return $token;
    }
private function parseToken ( Request $ request ) : ? Token { $ cookies = $ request -> getCookieParams ( ) ; $ cookieName = $ this -> defaultCookie -> getName ( ) ; if ( ! isset ( $ cookies [ $ cookieName ] ) ) { return null ; } try { $ token = $ this -> tokenParser -> parse ( $ cookies [ $ cookieName ] ) ; } catch ( \ InvalidArgumentException $ invalidToken ) { return null ; } if ( ! $ token -> validate ( new ValidationData ( ) ) ) { return null ; } return $ token ; }
Extract the token from the given request object
Extract the token from the given request object