src/Adapter/FileAdapter/ValueTrait.php
protected function handleTtl($key, $expireSetTs, $expireSec)
    {
        $ttl = $expireSetTs + $expireSec - time();
        if ($ttl <= 0) {
            $this->getClient()->delete($key);
            throw new KeyNotFoundException();
        }

        return $ttl;
    }
protected function handleTtl($key, $expireSetTs, $expireSec)
    {
        $ttl = $expireSetTs + $expireSec - time();
        if ($ttl <= 0) {
            $this->getClient()->delete($key);
            throw new KeyNotFoundException();
        }

        return $ttl;
    }
If ttl is lesser or equals 0 delete key.

@param string $key
@param int $expireSetTs
@param int $expireSec

@return int ttl

@throws KeyNotFoundException