public function set($id, $value)
    {
        if (isset($this->requested[$id])) {
            throw new ContainerRuntimeException(
                'Container identifier[' . $id . '] is already set and has been requested.'
            );
        }
        if (is_callable($value)) {
            $this->callables[$id] = $value;
        } else {
            $this->values[$id] = $value;
        }
        $this->keys[$id] = true;
    }
public function set($id, $value)
    {
        if (isset($this->requested[$id])) {
            throw new ContainerRuntimeException(
                'Container identifier[' . $id . '] is already set and has been requested.'
            );
        }
        if (is_callable($value)) {
            $this->callables[$id] = $value;
        } else {
            $this->values[$id] = $value;
        }
        $this->keys[$id] = true;
    }
public function set ( $ id , $ value ) { if ( isset ( $ this -> requested [ $ id ] ) ) { throw new ContainerRuntimeException ( 'Container identifier[' . $ id . '] is already set and has been requested.' ) ; } if ( is_callable ( $ value ) ) { $ this -> callables [ $ id ] = $ value ; } else { $ this -> values [ $ id ] = $ value ; } $ this -> keys [ $ id ] = true ; }
Beware that arg value as string will be considered a callable
if that string value matches a declared function.

@param string $id
@param callable|mixed $value
If callable, if will be called on first request.

@return void

@throws ContainerRuntimeException
\RuntimeException + \Psr\Container\ContainerExceptionInterface
If item by that id has been set previously and requested previously.
Beware that arg value as string will be considered a callable if that string value matches a declared function .