protected function untilToLifetime($until)
    {
        if (!$until instanceof DateTime) {
            return self::CACHE_LIFETIME;
        }

        return $until->getTimestamp() - (new DateTime())->getTimestamp();
    }
protected function untilToLifetime($until)
    {
        if (!$until instanceof DateTime) {
            return self::CACHE_LIFETIME;
        }

        return $until->getTimestamp() - (new DateTime())->getTimestamp();
    }
protected function untilToLifetime ( $ until ) { if ( ! $ until instanceof DateTime ) { return self :: CACHE_LIFETIME ; } return $ until -> getTimestamp ( ) - ( new DateTime ( ) ) -> getTimestamp ( ) ; }
Calculates the lifetime out of a DateTime value.

@param \DateTime|null $until

@return int
Calculates the lifetime out of a DateTime value .