protected function _set($key, $value, $ttl = null)
    {
        if ($ttl !== null) {
            $ttl = $this->_normalizeInt($ttl);
        }

        try {
            $this->_setData($key, $value);
        } catch (RootException $e) {
            if ($e instanceof InvalidArgumentException) {
                throw $e;
            }

            throw $this->_createContainerException($this->__('Could not set data'), null, $e, $this);
        }
    }
protected function _set($key, $value, $ttl = null)
    {
        if ($ttl !== null) {
            $ttl = $this->_normalizeInt($ttl);
        }

        try {
            $this->_setData($key, $value);
        } catch (RootException $e) {
            if ($e instanceof InvalidArgumentException) {
                throw $e;
            }

            throw $this->_createContainerException($this->__('Could not set data'), null, $e, $this);
        }
    }
protected function _set ( $ key , $ value , $ ttl = null ) { if ( $ ttl !== null ) { $ ttl = $ this -> _normalizeInt ( $ ttl ) ; } try { $ this -> _setData ( $ key , $ value ) ; } catch ( RootException $ e ) { if ( $ e instanceof InvalidArgumentException ) { throw $ e ; } throw $ this -> _createContainerException ( $ this -> __ ( 'Could not set data' ) , null , $ e , $ this ) ; } }
Sets a value for the specified key.

@since [*next-version*]

@param string|int|float|bool|Stringable $key   The key to set the value for.
@param mixed                            $value The value to set.
@param null|string|Stringable|int       $ttl   The maximal number of seconds, for which the value is considered valid.
If null, the TTL is unpredictable, perhaps indefinite.

@throws ContainerExceptionInterface If the value could not be set.
@throws InvalidArgumentException    If the key or the TTL is invalid.
Sets a value for the specified key .