src/Parameters.php
public function set($path, $value)
    {
        $keys       = $this->explode($path);
        $parameters = &$this->parameters;

        while (count($keys) > 0) {
            if (count($keys) === 1) {
                if (!is_array($parameters)) {
                    $parameters = [];
                }
                $parameters[array_shift($keys)] = $value;
            } else {
                $key = array_shift($keys);
                if (!isset($parameters[$key])) {
                    $parameters[$key] = [];
                }
                $parameters = &$parameters[$key];
            }
        }
        return $this;
    }
public function set($path, $value)
    {
        $keys       = $this->explode($path);
        $parameters = &$this->parameters;

        while (count($keys) > 0) {
            if (count($keys) === 1) {
                if (!is_array($parameters)) {
                    $parameters = [];
                }
                $parameters[array_shift($keys)] = $value;
            } else {
                $key = array_shift($keys);
                if (!isset($parameters[$key])) {
                    $parameters[$key] = [];
                }
                $parameters = &$parameters[$key];
            }
        }
        return $this;
    }
public function set ( $ path , $ value ) { $ keys = $ this -> explode ( $ path ) ; $ parameters = & $ this -> parameters ; while ( count ( $ keys ) > 0 ) { if ( count ( $ keys ) === 1 ) { if ( ! is_array ( $ parameters ) ) { $ parameters = [ ] ; } $ parameters [ array_shift ( $ keys ) ] = $ value ; } else { $ key = array_shift ( $ keys ) ; if ( ! isset ( $ parameters [ $ key ] ) ) { $ parameters [ $ key ] = [ ] ; } $ parameters = & $ parameters [ $ key ] ; } } return $ this ; }
Sets a value to a key path.

@param   string  $path
@param   mixed   $value
@return  self
Sets a value to a key path .