MatthiasMullie\Scrapbook\Adapters\Redis::ttl PHP Method

ttl() protected method

Redis expects true TTL, not expiration timestamp.
protected ttl ( integer $expire ) : integer | null
$expire integer
return integer | null TTL in seconds, or `null` for no expiration
    protected function ttl($expire)
    {
        if ($expire === 0) {
            return null;
        }
        // relative time in seconds, <30 days
        if ($expire > 30 * 24 * 60 * 60) {
            return $expire - time();
        }
        return $expire;
    }