protected function calculateExpiryTime(int $lifetime = null): \DateTime
    {
        if ($lifetime === self::UNLIMITED_LIFETIME || ($lifetime === null && $this->defaultLifetime === self::UNLIMITED_LIFETIME)) {
            return new \DateTime(self::DATETIME_EXPIRYTIME_UNLIMITED, new \DateTimeZone('UTC'));
        }

        if ($lifetime === null) {
            $lifetime = $this->defaultLifetime;
        }
        return new \DateTime('now +' . $lifetime . ' seconds', new \DateTimeZone('UTC'));
    }
protected function calculateExpiryTime(int $lifetime = null): \DateTime
    {
        if ($lifetime === self::UNLIMITED_LIFETIME || ($lifetime === null && $this->defaultLifetime === self::UNLIMITED_LIFETIME)) {
            return new \DateTime(self::DATETIME_EXPIRYTIME_UNLIMITED, new \DateTimeZone('UTC'));
        }

        if ($lifetime === null) {
            $lifetime = $this->defaultLifetime;
        }
        return new \DateTime('now +' . $lifetime . ' seconds', new \DateTimeZone('UTC'));
    }
protected function calculateExpiryTime ( int $ lifetime = null ) : \ DateTime { if ( $ lifetime === self :: UNLIMITED_LIFETIME || ( $ lifetime === null && $ this -> defaultLifetime === self :: UNLIMITED_LIFETIME ) ) { return new \ DateTime ( self :: DATETIME_EXPIRYTIME_UNLIMITED , new \ DateTimeZone ( 'UTC' ) ) ; } if ( $ lifetime === null ) { $ lifetime = $ this -> defaultLifetime ; } return new \ DateTime ( 'now +' . $ lifetime . ' seconds' , new \ DateTimeZone ( 'UTC' ) ) ; }
Calculates the expiry time by the given lifetime. If no lifetime is
specified, the default lifetime is used.

@param integer $lifetime The lifetime in seconds
@return \DateTime The expiry time
Calculates the expiry time by the given lifetime . If no lifetime is specified the default lifetime is used .