Lines Matching refs:uri

119      * @param UriInterface $uri   The URI to normalize
124 …public static function normalize(UriInterface $uri, int $flags = self::PRESERVING_NORMALIZATIONS):… argument
127 $uri = self::capitalizePercentEncoding($uri);
131 $uri = self::decodeUnreservedCharacters($uri);
134 if ($flags & self::CONVERT_EMPTY_PATH && $uri->getPath() === ''
135 && ($uri->getScheme() === 'http' || $uri->getScheme() === 'https')
137 $uri = $uri->withPath('/');
140 …if ($flags & self::REMOVE_DEFAULT_HOST && $uri->getScheme() === 'file' && $uri->getHost() === 'loc…
141 $uri = $uri->withHost('');
144 … if ($flags & self::REMOVE_DEFAULT_PORT && $uri->getPort() !== null && Uri::isDefaultPort($uri)) {
145 $uri = $uri->withPort(null);
148 if ($flags & self::REMOVE_DOT_SEGMENTS && !Uri::isRelativePathReference($uri)) {
149 $uri = $uri->withPath(UriResolver::removeDotSegments($uri->getPath()));
153 $uri = $uri->withPath(preg_replace('#//++#', '/', $uri->getPath()));
156 if ($flags & self::SORT_QUERY_PARAMETERS && $uri->getQuery() !== '') {
157 $queryKeyValues = explode('&', $uri->getQuery());
159 $uri = $uri->withQuery(implode('&', $queryKeyValues));
162 return $uri;
184 private static function capitalizePercentEncoding(UriInterface $uri): UriInterface argument
193 $uri->withPath(
194 preg_replace_callback($regex, $callback, $uri->getPath())
196 preg_replace_callback($regex, $callback, $uri->getQuery())
200 private static function decodeUnreservedCharacters(UriInterface $uri): UriInterface argument
209 $uri->withPath(
210 preg_replace_callback($regex, $callback, $uri->getPath())
212 preg_replace_callback($regex, $callback, $uri->getQuery())