Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. UriNormalizer.php

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\Psr7

Code

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);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal