[ Index ]

PHP Cross Reference of phpBB-3.3.5-deutsch

title

Body

[close]

/vendor/guzzlehttp/psr7/src/ -> UriNormalizer.php (summary)

Provides methods to normalize and compare URIs.

Author: Tobias Schultze
File Size: 219 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 5 functions

  normalize()
  isEquivalent()
  capitalizePercentEncoding()
  decodeUnreservedCharacters()
  __construct()

Functions
Functions that are not part of a class:

normalize(UriInterface $uri, $flags = self::PRESERVING_NORMALIZATIONS)   X-Ref
Returns a normalized URI.

The scheme and host component are already normalized to lowercase per PSR-7 UriInterface.
This methods adds additional normalizations that can be configured with the $flags parameter.

PSR-7 UriInterface cannot distinguish between an empty component and a missing component as
getQuery(), getFragment() etc. always return a string. This means the URIs "/?#" and "/" are
treated equivalent which is not necessarily true according to RFC 3986. But that difference
is highly uncommon in reality. So this potential normalization is implied in PSR-7 as well.

param: UriInterface $uri   The URI to normalize
param: int          $flags A bitmask of normalizations to apply, see constants
return: UriInterface The normalized URI

isEquivalent(UriInterface $uri1, UriInterface $uri2, $normalizations = self::PRESERVING_NORMALIZATIONS)   X-Ref
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.

param: UriInterface $uri1           An URI to compare
param: UriInterface $uri2           An URI to compare
param: int          $normalizations A bitmask of normalizations to apply, see constants
return: bool

capitalizePercentEncoding(UriInterface $uri)   X-Ref
No description

decodeUnreservedCharacters(UriInterface $uri)   X-Ref
No description

__construct()   X-Ref
No description



Generated: Mon Oct 4 17:42:11 2021 Cross-referenced by PHPXref 0.7.1