public function set($part, $value)
    {
        if (!in_array($part, self::$parts)) {
            throw new \OutOfBoundsException("$part is not a valid url part");
        }

        $this->components[$part] = $value;
        return $this;
    }
public function set($part, $value)
    {
        if (!in_array($part, self::$parts)) {
            throw new \OutOfBoundsException("$part is not a valid url part");
        }

        $this->components[$part] = $value;
        return $this;
    }
public function set ( $ part , $ value ) { if ( ! in_array ( $ part , self :: $ parts ) ) { throw new \ OutOfBoundsException ( "$part is not a valid url part" ) ; } $ this -> components [ $ part ] = $ value ; return $ this ; }
Set a URL part.

@param string $part
@param mixed $value
@return self
@throws \OutOfBoundsException
Set a URL part .