src/Adapter/MemoryAdapter/ValueTrait.php
protected function handleTtl($key, $expireSetTs, $expireSec)
    {
        $ttl = $expireSetTs + $expireSec - time();
        if ($ttl <= 0) {
            unset($this->store[$key]);

            throw new KeyNotFoundException();
        }

        return $ttl;
    }
protected function handleTtl($key, $expireSetTs, $expireSec)
    {
        $ttl = $expireSetTs + $expireSec - time();
        if ($ttl <= 0) {
            unset($this->store[$key]);

            throw new KeyNotFoundException();
        }

        return $ttl;
    }
protected function handleTtl ( $ key , $ expireSetTs , $ expireSec ) { $ ttl = $ expireSetTs + $ expireSec - time ( ) ; if ( $ ttl <= 0 ) { unset ( $ this -> store [ $ 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
If ttl is lesser or equals 0 delete key .