function UriNormalizer::isEquivalent
Whether two URIs can be considered equivalent.
Both URIs are normalized automatically before comparison with the given $normalizations bitmask. The method also accepts relative URI references and returns true when they are equivalent. This of course assumes they will be resolved against the same base URI. If this is not the case, determination of equivalence or difference of relative references does not mean anything.
Parameters
UriInterface $uri1 An URI to compare:
UriInterface $uri2 An URI to compare:
int $normalizations A bitmask of normalizations to apply, see constants:
See also
https://datatracker.ietf.org/doc/html/rfc3986#section-6.1
File
-
vendor/
guzzlehttp/ psr7/ src/ UriNormalizer.php, line 179
Class
- UriNormalizer
- Provides methods to normalize and compare URIs.
Namespace
GuzzleHttp\Psr7Code
public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, int $normalizations = self::PRESERVING_NORMALIZATIONS) : bool {
return (string) self::normalize($uri1, $normalizations) === (string) self::normalize($uri2, $normalizations);
}