YoastSEO_Vendor\GuzzleHttp\Psr7
uri_for() Yoast 1.0
Returns a UriInterface for the given value.
This function accepts a string or {@see Psr\Http\Message\UriInterface} and returns a UriInterface for the given value. If the value is already a UriInterface, it is returned as-is.
Хуков нет.
Возвращает
UriInterface.
Использование
uri_for( $uri );
- $uri(строка/Uriчислоerface) (обязательный)
Код uri_for() uri for Yoast 15.6.2
function uri_for($uri)
{
if ($uri instanceof \YoastSEO_Vendor\Psr\Http\Message\UriInterface) {
return $uri;
} elseif (\is_string($uri)) {
return new \YoastSEO_Vendor\GuzzleHttp\Psr7\Uri($uri);
}
throw new \InvalidArgumentException('URI must be a string or UriInterface');
}