public static function getExpireTime($cacheDuration = null, $validUntil = null)
    {
        $expireTime = null;

        if ($cacheDuration !== null) {
            $expireTime = self::parseDuration($cacheDuration, time());
        }

        if ($validUntil !== null) {
            if (is_int($validUntil)) {
                $validUntilTime = $validUntil;
            } else {
                $validUntilTime = self::parseSAML2Time($validUntil);
            }
            if ($expireTime === null || $expireTime > $validUntilTime) {
                $expireTime = $validUntilTime;
            }
        }

        return $expireTime;
    }
public static function getExpireTime($cacheDuration = null, $validUntil = null)
    {
        $expireTime = null;

        if ($cacheDuration !== null) {
            $expireTime = self::parseDuration($cacheDuration, time());
        }

        if ($validUntil !== null) {
            if (is_int($validUntil)) {
                $validUntilTime = $validUntil;
            } else {
                $validUntilTime = self::parseSAML2Time($validUntil);
            }
            if ($expireTime === null || $expireTime > $validUntilTime) {
                $expireTime = $validUntilTime;
            }
        }

        return $expireTime;
    }
public static function getExpireTime ( $ cacheDuration = null , $ validUntil = null ) { $ expireTime = null ; if ( $ cacheDuration !== null ) { $ expireTime = self :: parseDuration ( $ cacheDuration , time ( ) ) ; } if ( $ validUntil !== null ) { if ( is_int ( $ validUntil ) ) { $ validUntilTime = $ validUntil ; } else { $ validUntilTime = self :: parseSAML2Time ( $ validUntil ) ; } if ( $ expireTime === null || $ expireTime > $ validUntilTime ) { $ expireTime = $ validUntilTime ; } } return $ expireTime ; }
Compares 2 dates and returns the earliest.

@param string|null $cacheDuration The duration, as a string.
@param string|int|null $validUntil The valid until date, as a string or as a timestamp

@return int|null $expireTime  The expiration time.

@throws Exception
Compares 2 dates and returns the earliest .