thephpleague / uri-src

URI manipulation Library
https://uri.thephpleague.com
MIT License
30 stars 7 forks source link

Adding BaseUri::unixPath and BaseUri::windowsPath #125

Closed nyamsprod closed 1 year ago

nyamsprod commented 1 year ago

This PR resolve #124 by adding two new methods to BaseUri:

The conversion can only be made if there is no scheme OR if the scheme is file. For any other scheme the methods will return null.

stof commented 1 year ago

As my use case will involve dealing with an argument being League\Uri\Contracts\UriInterface, am I right when thinking that the usage of those new methods would look like that ?

return BaseUri::from($uri)->unixPath();
nyamsprod commented 1 year ago

@stof you are correct on the usage. This way any kind of URI can be used even string URI.