public function set($key, $value)
    {
        $keys = explode('.', $key);

        $data = &$this->parameters;

        while (count($keys) > 1) {
            $pkey = $keys[0];

            if (!array_key_exists($pkey, $data) || !is_array($data[$pkey])) {
                $data[$pkey] = [];
            }

            $data = &$data[$pkey];
            array_shift($keys);
        }

        $data[$keys[0]] = $value;

        return $this;
    }
public function set($key, $value)
    {
        $keys = explode('.', $key);

        $data = &$this->parameters;

        while (count($keys) > 1) {
            $pkey = $keys[0];

            if (!array_key_exists($pkey, $data) || !is_array($data[$pkey])) {
                $data[$pkey] = [];
            }

            $data = &$data[$pkey];
            array_shift($keys);
        }

        $data[$keys[0]] = $value;

        return $this;
    }
public function set ( $ key , $ value ) { $ keys = explode ( '.' , $ key ) ; $ data = & $ this -> parameters ; while ( count ( $ keys ) > 1 ) { $ pkey = $ keys [ 0 ] ; if ( ! array_key_exists ( $ pkey , $ data ) || ! is_array ( $ data [ $ pkey ] ) ) { $ data [ $ pkey ] = [ ] ; } $ data = & $ data [ $ pkey ] ; array_shift ( $ keys ) ; } $ data [ $ keys [ 0 ] ] = $ value ; return $ this ; }
Sets a parameter by name.

@param string $key   The key
@param mixed  $value The value

@return $this
Sets a parameter by name .