New Canonicalizer class
This library now ships with an URL canonicalizer.
The canonicalize() function accepts any PSR-7 UriInterface object and will return a canonicalized one.
use function BenTools\UriFactory\Helper\canonicalize;
use function BenTools\UriFactory\Helper\uri;
$url = 'http://example.org../foo/../bar/?#baz';
echo canonicalize(uri($url)); // http://example.org/bar/