Introduce proper URI class
Replace all methods required something like string $uri
into something like URI $uri
.
The new URI class should validate that input strings are valid URIs. If they are not, it should fail.
Additionally a convenience factory method such as URI::createFromNativePath($path)
can be provided, but this should not be the default in the constructor. Callers need to explicitly opt-in to this conversion as they should know if they are working with URIs already (in which case no conversion is necessary) or with native paths.