public function isTokenExpired(string $token): bool
    {
        if (!$this->isTokenValid($token)) {
            throw new \InvalidArgumentException('This token is invalid');
        }
        $tokenData = $this->decryptToken($token);
        $tokenExpiration = $tokenData['generated'] + $tokenData['validForSeconds'];

        return $tokenExpiration < time();
    }
public function isTokenExpired(string $token): bool
    {
        if (!$this->isTokenValid($token)) {
            throw new \InvalidArgumentException('This token is invalid');
        }
        $tokenData = $this->decryptToken($token);
        $tokenExpiration = $tokenData['generated'] + $tokenData['validForSeconds'];

        return $tokenExpiration < time();
    }
public function isTokenExpired ( string $ token ) : bool { if ( ! $ this -> isTokenValid ( $ token ) ) { throw new \ InvalidArgumentException ( 'This token is invalid' ) ; } $ tokenData = $ this -> decryptToken ( $ token ) ; $ tokenExpiration = $ tokenData [ 'generated' ] + $ tokenData [ 'validForSeconds' ] ; return $ tokenExpiration < time ( ) ; }
Checks if the given token is expired

@param string $token String token
@return bool
@throws \InvalidArgumentException
Checks if the given token is expired