diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 11:30:21 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 11:30:21 +0000 |
commit | 8442dc94b1e5f57cd1558dbc9a27ad82066a8cfc (patch) | |
tree | 33b468a7f90c26b19c889cf755ee60d23a585627 /vendor/guzzlehttp/psr7/src/Uri.php | |
parent | Adding upstream version 0.13.1. (diff) | |
download | icinga-php-library-upstream.tar.xz icinga-php-library-upstream.zip |
Adding upstream version 0.13.2.upstream/0.13.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/guzzlehttp/psr7/src/Uri.php')
-rw-r--r-- | vendor/guzzlehttp/psr7/src/Uri.php | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/vendor/guzzlehttp/psr7/src/Uri.php b/vendor/guzzlehttp/psr7/src/Uri.php index fbba7f1..f1feee8 100644 --- a/vendor/guzzlehttp/psr7/src/Uri.php +++ b/vendor/guzzlehttp/psr7/src/Uri.php @@ -41,14 +41,14 @@ class Uri implements UriInterface, \JsonSerializable /** * Unreserved characters for use in a regex. * - * @see https://tools.ietf.org/html/rfc3986#section-2.3 + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-2.3 */ private const CHAR_UNRESERVED = 'a-zA-Z0-9_\-\.~'; /** * Sub-delims for use in a regex. * - * @see https://tools.ietf.org/html/rfc3986#section-2.2 + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-2.2 */ private const CHAR_SUB_DELIMS = '!\$&\'\(\)\*\+,;='; private const QUERY_SEPARATORS_REPLACEMENT = ['=' => '%3D', '&' => '%26']; @@ -162,7 +162,7 @@ class Uri implements UriInterface, \JsonSerializable * `file:///` is the more common syntax for the file scheme anyway (Chrome for example redirects to * that format). * - * @see https://tools.ietf.org/html/rfc3986#section-5.3 + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-5.3 */ public static function composeComponents(?string $scheme, ?string $authority, string $path, ?string $query, ?string $fragment): string { @@ -219,7 +219,7 @@ class Uri implements UriInterface, \JsonSerializable * @see Uri::isNetworkPathReference * @see Uri::isAbsolutePathReference * @see Uri::isRelativePathReference - * @see https://tools.ietf.org/html/rfc3986#section-4 + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-4 */ public static function isAbsolute(UriInterface $uri): bool { @@ -231,7 +231,7 @@ class Uri implements UriInterface, \JsonSerializable * * A relative reference that begins with two slash characters is termed an network-path reference. * - * @see https://tools.ietf.org/html/rfc3986#section-4.2 + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-4.2 */ public static function isNetworkPathReference(UriInterface $uri): bool { @@ -243,7 +243,7 @@ class Uri implements UriInterface, \JsonSerializable * * A relative reference that begins with a single slash character is termed an absolute-path reference. * - * @see https://tools.ietf.org/html/rfc3986#section-4.2 + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-4.2 */ public static function isAbsolutePathReference(UriInterface $uri): bool { @@ -258,7 +258,7 @@ class Uri implements UriInterface, \JsonSerializable * * A relative reference that does not begin with a slash character is termed a relative-path reference. * - * @see https://tools.ietf.org/html/rfc3986#section-4.2 + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-4.2 */ public static function isRelativePathReference(UriInterface $uri): bool { @@ -277,7 +277,7 @@ class Uri implements UriInterface, \JsonSerializable * @param UriInterface $uri The URI to check * @param UriInterface|null $base An optional base URI to compare against * - * @see https://tools.ietf.org/html/rfc3986#section-4.4 + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-4.4 */ public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null): bool { @@ -336,8 +336,8 @@ class Uri implements UriInterface, \JsonSerializable * * It has the same behavior as withQueryValue() but for an associative array of key => value. * - * @param UriInterface $uri URI to use as a base. - * @param array<string, string|null> $keyValueArray Associative array of key and values + * @param UriInterface $uri URI to use as a base. + * @param (string|null)[] $keyValueArray Associative array of key and values */ public static function withQueryValues(UriInterface $uri, array $keyValueArray): UriInterface { @@ -353,7 +353,7 @@ class Uri implements UriInterface, \JsonSerializable /** * Creates a URI from a hash of `parse_url` components. * - * @see http://php.net/manual/en/function.parse-url.php + * @see https://www.php.net/manual/en/function.parse-url.php * * @throws MalformedUriException If the components do not form a valid URI. */ @@ -638,7 +638,7 @@ class Uri implements UriInterface, \JsonSerializable } /** - * @param string[] $keys + * @param (string|int)[] $keys * * @return string[] */ @@ -650,7 +650,9 @@ class Uri implements UriInterface, \JsonSerializable return []; } - $decodedKeys = array_map('rawurldecode', $keys); + $decodedKeys = array_map(function ($k): string { + return rawurldecode((string) $k); + }, $keys); return array_filter(explode('&', $current), function ($part) use ($decodedKeys) { return !in_array(rawurldecode(explode('=', $part)[0]), $decodedKeys, true); |