Hi Rowan > > Rather than a *representation* of a URL, think of the class as a > *builder* for URLs. There are multiple methods because you might want to > build the URL in different orders ("start with this URL but replace the > port", "start with this domain and I'll add the path later", etc). All > the flags are related to how the input should be interpreted, and the > output manipulated, in order to build a correctly formatted URL string. >
Sorry if it was really not clear in the RFC since I didn't even talk about the CURLOPT_CURLU option, but this class is not only there to parse/build strings for Curl but to give this specific object to Curl instead of a string representation of an URL. > > Maybe it should even be called CurlUrlBuilder? That also fits with the > design of having mutable setters; as Derick pointed out, mutable value > objects are generally a bad idea, so it would make sense to encourage > users to think of this as a way to get one or more strings, rather than > as a result in itself. > Since you can give this object to curl instead of an URL string, I would not call it CurlUrlBuilder. Regards, Pierrick