WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

YoastSEO_Vendor\GuzzleHttp\Psr7

UriNormalizer::normalize() public Yoast 1.0

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.

{} Это метод класса: UriNormalizer{}

Хуков нет.

Возвращает

UriInterface. The normalized URI

Использование

$result = UriNormalizer::normalize( \YoastSEO_Vendor\Psr\Http\Message\UriInterface $uri, $flags );
$uri(Uriчислоerface) (обязательный)
The URI to normalize
$flags(число)
A bitmask of normalizations to apply, see constants
По умолчанию: self::PRESERVING_NORMALIZATIONS

Код UriNormalizer::normalize() Yoast 15.6.2

<?php
public static function normalize(\YoastSEO_Vendor\Psr\Http\Message\UriInterface $uri, $flags = self::PRESERVING_NORMALIZATIONS)
{
    if ($flags & self::CAPITALIZE_PERCENT_ENCODING) {
        $uri = self::capitalizePercentEncoding($uri);
    }
    if ($flags & self::DECODE_UNRESERVED_CHARACTERS) {
        $uri = self::decodeUnreservedCharacters($uri);
    }
    if ($flags & self::CONVERT_EMPTY_PATH && $uri->getPath() === '' && ($uri->getScheme() === 'http' || $uri->getScheme() === 'https')) {
        $uri = $uri->withPath('/');
    }
    if ($flags & self::REMOVE_DEFAULT_HOST && $uri->getScheme() === 'file' && $uri->getHost() === 'localhost') {
        $uri = $uri->withHost('');
    }
    if ($flags & self::REMOVE_DEFAULT_PORT && $uri->getPort() !== null && \YoastSEO_Vendor\GuzzleHttp\Psr7\Uri::isDefaultPort($uri)) {
        $uri = $uri->withPort(null);
    }
    if ($flags & self::REMOVE_DOT_SEGMENTS && !\YoastSEO_Vendor\GuzzleHttp\Psr7\Uri::isRelativePathReference($uri)) {
        $uri = $uri->withPath(\YoastSEO_Vendor\GuzzleHttp\Psr7\UriResolver::removeDotSegments($uri->getPath()));
    }
    if ($flags & self::REMOVE_DUPLICATE_SLASHES) {
        $uri = $uri->withPath(\preg_replace('#//++#', '/', $uri->getPath()));
    }
    if ($flags & self::SORT_QUERY_PARAMETERS && $uri->getQuery() !== '') {
        $queryKeyValues = \explode('&', $uri->getQuery());
        \sort($queryKeyValues);
        $uri = $uri->withQuery(\implode('&', $queryKeyValues));
    }
    return $uri;
}