public function expired(\DateTime $date = null)
    {
        // Check if the token has an expiration date.
        if (!$this->expire) {
            return false;
        }

        $date = $date ?: new \DateTime('now', new \DateTimezone('UTC'));

        return ($date > $this->expire);
    }
public function expired(\DateTime $date = null)
    {
        // Check if the token has an expiration date.
        if (!$this->expire) {
            return false;
        }

        $date = $date ?: new \DateTime('now', new \DateTimezone('UTC'));

        return ($date > $this->expire);
    }
public function expired ( \ DateTime $ date = null ) { // Check if the token has an expiration date. if ( ! $ this -> expire ) { return false ; } $ date = $ date ? : new \ DateTime ( 'now' , new \ DateTimezone ( 'UTC' ) ) ; return ( $ date > $ this -> expire ) ; }
Checks whether the token has expired or is still valid.

If the token has no expiration date, assumes the token doesn't expire.

@param \DateTime $date
(optional) The date to compare with the epiration date of the token.
If not provided, the current time is used.

@return bool
Checks whether the token has expired or is still valid .