WordPress\AiClientDependencies\Nyholm\Psr7

Uri::getPath │ public │ WP 1.0

Метод класса: Uri{}

Хуков нет.

Возвращает

null. Ничего (null).

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

$Uri = new Uri();
$Uri->getPath(): string;

Код Uri::getPath() WP 7.1.4

public function getPath(): string
{
    $path = $this->path;
    if ('' !== $path && '/' !== $path[0]) {
        if ('' !== $this->host) {
            // If the path is rootless and an authority is present, the path MUST be prefixed by "/"
            $path = '/' . $path;
        }
    } elseif (isset($path[1]) && '/' === $path[1]) {
        // If the path is starting with more than one "/", the
        // starting slashes MUST be reduced to one.
        $path = '/' . \ltrim($path, '/');
    }
    return $path;
}