Lines Matching refs:uri

114      * @param UriInterface $uri   The URI to normalize
121 public static function normalize(UriInterface $uri, $flags = self::PRESERVING_NORMALIZATIONS) argument
124 $uri = self::capitalizePercentEncoding($uri);
128 $uri = self::decodeUnreservedCharacters($uri);
131 if ($flags & self::CONVERT_EMPTY_PATH && $uri->getPath() === '' &&
132 ($uri->getScheme() === 'http' || $uri->getScheme() === 'https')
134 $uri = $uri->withPath('/');
137 …if ($flags & self::REMOVE_DEFAULT_HOST && $uri->getScheme() === 'file' && $uri->getHost() === 'loc…
138 $uri = $uri->withHost('');
141 … if ($flags & self::REMOVE_DEFAULT_PORT && $uri->getPort() !== null && Uri::isDefaultPort($uri)) {
142 $uri = $uri->withPort(null);
145 if ($flags & self::REMOVE_DOT_SEGMENTS && !Uri::isRelativePathReference($uri)) {
146 $uri = $uri->withPath(UriResolver::removeDotSegments($uri->getPath()));
150 $uri = $uri->withPath(preg_replace('#//++#', '/', $uri->getPath()));
153 if ($flags & self::SORT_QUERY_PARAMETERS && $uri->getQuery() !== '') {
154 $queryKeyValues = explode('&', $uri->getQuery());
156 $uri = $uri->withQuery(implode('&', $queryKeyValues));
159 return $uri;
183 private static function capitalizePercentEncoding(UriInterface $uri) argument
192 $uri->withPath(
193 preg_replace_callback($regex, $callback, $uri->getPath())
195 preg_replace_callback($regex, $callback, $uri->getQuery())
199 private static function decodeUnreservedCharacters(UriInterface $uri) argument
208 $uri->withPath(
209 preg_replace_callback($regex, $callback, $uri->getPath())
211 preg_replace_callback($regex, $callback, $uri->getQuery())