protected function fromArray($array)
    {
        if (empty($array)) {
            return $this;
        }

        $this->query = new QueryString();

        if (!empty($array['query'])) {
            $this->query->import($array['query']);
        }

        $keys = array(
            'scheme',
            'host',
            'port',
            'user',
            'pass',
            'path',
            'fragment',
            'dirname',
            'basename',
            'extension',
            'filename',
        );

        foreach ($keys as $key) {
            if (!isset($array[$key])) {
                continue;
            }

            $this->$key = $array[$key];

            if ($key === 'path') {
                $this->parsePath($this->path);
            }
        }

        $this->buildPath();

        return $this;
    }
protected function fromArray($array)
    {
        if (empty($array)) {
            return $this;
        }

        $this->query = new QueryString();

        if (!empty($array['query'])) {
            $this->query->import($array['query']);
        }

        $keys = array(
            'scheme',
            'host',
            'port',
            'user',
            'pass',
            'path',
            'fragment',
            'dirname',
            'basename',
            'extension',
            'filename',
        );

        foreach ($keys as $key) {
            if (!isset($array[$key])) {
                continue;
            }

            $this->$key = $array[$key];

            if ($key === 'path') {
                $this->parsePath($this->path);
            }
        }

        $this->buildPath();

        return $this;
    }
protected function fromArray ( $ array ) { if ( empty ( $ array ) ) { return $ this ; } $ this -> query = new QueryString ( ) ; if ( ! empty ( $ array [ 'query' ] ) ) { $ this -> query -> import ( $ array [ 'query' ] ) ; } $ keys = array ( 'scheme' , 'host' , 'port' , 'user' , 'pass' , 'path' , 'fragment' , 'dirname' , 'basename' , 'extension' , 'filename' , ) ; foreach ( $ keys as $ key ) { if ( ! isset ( $ array [ $ key ] ) ) { continue ; } $ this -> $ key = $ array [ $ key ] ; if ( $ key === 'path' ) { $ this -> parsePath ( $ this -> path ) ; } } $ this -> buildPath ( ) ; return $ this ; }
Import from an array

@param array $array

@return Uri
Import from an array