public function isExpired($lifetime)
    {
        $interval = $this->createdOn->diff(new \DateTimeImmutable());

        return $interval->s >= (int) $lifetime;
    }
public function isExpired($lifetime)
    {
        $interval = $this->createdOn->diff(new \DateTimeImmutable());

        return $interval->s >= (int) $lifetime;
    }
public function isExpired ( $ lifetime ) { $ interval = $ this -> createdOn -> diff ( new \ DateTimeImmutable ( ) ) ; return $ interval -> s >= ( int ) $ lifetime ; }
Checks if the token is expired comparing
with the given lifetime.

@param int $lifetime The lifetime of the token

@return bool
Checks if the token is expired comparing with the given lifetime .