docs/class-Psr.Http.Message.UriInterface.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Interface Psr\Http\Message\UriInterface | ξ ^ω^)ξ Baguette PHP Mastodon API Client / SDK</title>
<link rel="stylesheet" href="resources/style.css?c2f33731c1948fbed7c333554678bfa68d4817da">
</head>
<body>
<div id="left">
<div id="menu">
<a href="index.html" title="Overview"><span>Overview</span></a>
<div id="groups">
<h3>Namespaces</h3>
<ul>
<li>
<a href="namespace-Baguette.html">
Baguette<span></span>
</a>
<ul>
<li>
<a href="namespace-Baguette.Mastodon.html">
Mastodon<span></span>
</a>
<ul>
<li class="main">
<a href="namespace-Baguette.Mastodon.Config.html">
Config </a>
</li>
<li class="main">
<a href="namespace-Baguette.Mastodon.Entity.html">
Entity </a>
</li>
<li class="main">
<a href="namespace-Baguette.Mastodon.Grant.html">
Grant </a>
</li>
<li class="main">
<a href="namespace-Baguette.Mastodon.Service.html">
Service </a>
</li>
</ul></li></ul></li>
<li>
<a href="namespace-GuzzleHttp.html">
GuzzleHttp<span></span>
</a>
<ul>
<li>
<a href="namespace-GuzzleHttp.Cookie.html">
Cookie </a>
</li>
<li>
<a href="namespace-GuzzleHttp.Exception.html">
Exception </a>
</li>
<li>
<a href="namespace-GuzzleHttp.Handler.html">
Handler </a>
</li>
<li>
<a href="namespace-GuzzleHttp.Promise.html">
Promise </a>
</li>
</ul></li>
<li class="active">
<a href="namespace-Psr.html">
Psr<span></span>
</a>
<ul>
<li class="active">
<a href="namespace-Psr.Http.html">
Http<span></span>
</a>
<ul>
<li class="active">
<a href="namespace-Psr.Http.Message.html">
Message </a>
</li>
</ul></li></ul></li>
<li>
<a href="namespace-Teto.html">
Teto<span></span>
</a>
<ul>
<li>
<a href="namespace-Teto.Object.html">
Object </a>
</li>
</ul></li>
</ul>
</div>
<hr>
<div id="elements">
<h3>Interfaces</h3>
<ul>
<li><a href="class-Psr.Http.Message.MessageInterface.html">MessageInterface</a></li>
<li><a href="class-Psr.Http.Message.RequestInterface.html">RequestInterface</a></li>
<li><a href="class-Psr.Http.Message.ResponseInterface.html">ResponseInterface</a></li>
<li><a href="class-Psr.Http.Message.ServerRequestInterface.html">ServerRequestInterface</a></li>
<li><a href="class-Psr.Http.Message.StreamInterface.html">StreamInterface</a></li>
<li><a href="class-Psr.Http.Message.UploadedFileInterface.html">UploadedFileInterface</a></li>
<li class="active"><a href="class-Psr.Http.Message.UriInterface.html">UriInterface</a></li>
</ul>
</div>
</div>
</div>
<div id="splitter"></div>
<div id="right">
<div id="rightInner">
<form id="search">
<input type="hidden" name="cx" value="">
<input type="hidden" name="ie" value="UTF-8">
<input type="text" name="q" class="text" placeholder="Search">
</form>
<div id="navigation">
<ul>
<li>
<a href="index.html" title="Overview"><span>Overview</span></a>
</li>
<li>
<a href="namespace-Psr.Http.Message.html" title="Summary of Psr\Http\Message"><span>Namespace</span></a>
</li>
<li class="active">
<span>Class</span> </li>
</ul>
<ul>
</ul>
<ul>
</ul>
</div>
<div id="content" class="class">
<h1>Interface UriInterface</h1>
<div class="description">
<p>Value object representing a URI.</p>
<p>This interface is meant to represent URIs according to RFC 3986 and to
provide methods for most common operations. Additional functionality for
working with URIs can be provided on top of the interface or externally.
Its primary use is for HTTP requests, but may also be used in other
contexts.</p>
<p>Instances of this interface are considered immutable; all methods that
might change state MUST be implemented such that they retain the internal
state of the current instance and return an instance that contains the
changed state.</p>
<p>Typically the Host header will be also be present in the request message.
For server-side requests, the scheme will typically be discoverable in the
server parameters.</p>
</div>
<div class="info">
<b>Namespace:</b> <a href="namespace-Psr.html">Psr</a>\<a href="namespace-Psr.Http.html">Http</a>\<a href="namespace-Psr.Http.Message.html">Message</a><br>
<b>Link:</b>
<a href="http://tools.ietf.org/html/rfc3986">(the URI specification)</a><br>
<b>Located at</b> <a href="source-class-Psr.Http.Message.UriInterface.html#4-323" title="Go to source code">UriInterface.php</a>
<br>
</div>
<table class="summary methods" id="methods">
<caption>Methods summary</caption>
<tr data-order="getScheme" id="_getScheme">
<td class="attributes"><code>
public
string
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_getScheme">#</a>
<code><a href="source-class-Psr.Http.Message.UriInterface.html#26-40" title="Go to source code">getScheme</a>( )</code>
<div class="description short">
<p>Retrieve the scheme component of the URI.</p>
</div>
<div class="description detailed hidden">
<p>Retrieve the scheme component of the URI.</p>
<p>If no scheme is present, this method MUST return an empty string.</p>
<p>The value returned MUST be normalized to lowercase, per RFC 3986
Section 3.1.</p>
<p>The trailing ":" character is not part of the scheme and MUST NOT be
added.</p>
<h4>Returns</h4>
<div class="list">
string<br>The URI scheme.
</div>
<h4>See</h4>
<div class="list">
https://tools.ietf.org/html/rfc3986#section-3.1<br>
</div>
</div>
</div></td>
</tr>
<tr data-order="getAuthority" id="_getAuthority">
<td class="attributes"><code>
public
string
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_getAuthority">#</a>
<code><a href="source-class-Psr.Http.Message.UriInterface.html#42-60" title="Go to source code">getAuthority</a>( )</code>
<div class="description short">
<p>Retrieve the authority component of the URI.</p>
</div>
<div class="description detailed hidden">
<p>Retrieve the authority component of the URI.</p>
<p>If no authority information is present, this method MUST return an empty
string.</p>
<p>The authority syntax of the URI is:</p>
<pre>[user-info@]host[:port]</pre>
<p>If the port component is not set or is the standard port for the current
scheme, it SHOULD NOT be included.</p>
<h4>Returns</h4>
<div class="list">
string<br>The URI authority, in "[user-info@]host[:port]" format.
</div>
<h4>See</h4>
<div class="list">
https://tools.ietf.org/html/rfc3986#section-3.2<br>
</div>
</div>
</div></td>
</tr>
<tr data-order="getUserInfo" id="_getUserInfo">
<td class="attributes"><code>
public
string
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_getUserInfo">#</a>
<code><a href="source-class-Psr.Http.Message.UriInterface.html#62-77" title="Go to source code">getUserInfo</a>( )</code>
<div class="description short">
<p>Retrieve the user information component of the URI.</p>
</div>
<div class="description detailed hidden">
<p>Retrieve the user information component of the URI.</p>
<p>If no user information is present, this method MUST return an empty
string.</p>
<p>If a user is present in the URI, this will return that value;
additionally, if the password is also present, it will be appended to the
user value, with a colon (":") separating the values.</p>
<p>The trailing "@" character is not part of the user information and MUST
NOT be added.</p>
<h4>Returns</h4>
<div class="list">
string<br>The URI user information, in "username[:password]" format.
</div>
</div>
</div></td>
</tr>
<tr data-order="getHost" id="_getHost">
<td class="attributes"><code>
public
string
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_getHost">#</a>
<code><a href="source-class-Psr.Http.Message.UriInterface.html#79-90" title="Go to source code">getHost</a>( )</code>
<div class="description short">
<p>Retrieve the host component of the URI.</p>
</div>
<div class="description detailed hidden">
<p>Retrieve the host component of the URI.</p>
<p>If no host is present, this method MUST return an empty string.</p>
<p>The value returned MUST be normalized to lowercase, per RFC 3986
Section 3.2.2.</p>
<h4>Returns</h4>
<div class="list">
string<br>The URI host.
</div>
<h4>See</h4>
<div class="list">
http://tools.ietf.org/html/rfc3986#section-3.2.2<br>
</div>
</div>
</div></td>
</tr>
<tr data-order="getPort" id="_getPort">
<td class="attributes"><code>
public
null|integer
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_getPort">#</a>
<code><a href="source-class-Psr.Http.Message.UriInterface.html#92-107" title="Go to source code">getPort</a>( )</code>
<div class="description short">
<p>Retrieve the port component of the URI.</p>
</div>
<div class="description detailed hidden">
<p>Retrieve the port component of the URI.</p>
<p>If a port is present, and it is non-standard for the current scheme,
this method MUST return it as an integer. If the port is the standard port
used with the current scheme, this method SHOULD return null.</p>
<p>If no port is present, and no scheme is present, this method MUST return
a null value.</p>
<p>If no port is present, but a scheme is present, this method MAY return
the standard port for that scheme, but SHOULD return null.</p>
<h4>Returns</h4>
<div class="list">
null|integer<br>The URI port.
</div>
</div>
</div></td>
</tr>
<tr data-order="getPath" id="_getPath">
<td class="attributes"><code>
public
string
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_getPath">#</a>
<code><a href="source-class-Psr.Http.Message.UriInterface.html#109-134" title="Go to source code">getPath</a>( )</code>
<div class="description short">
<p>Retrieve the path component of the URI.</p>
</div>
<div class="description detailed hidden">
<p>Retrieve the path component of the URI.</p>
<p>The path can either be empty or absolute (starting with a slash) or
rootless (not starting with a slash). Implementations MUST support all
three syntaxes.</p>
<p>Normally, the empty path "" and absolute path "/" are considered equal as
defined in RFC 7230 Section 2.7.3. But this method MUST NOT automatically
do this normalization because in contexts with a trimmed base path, e.g.
the front controller, this difference becomes significant. It's the task
of the user to handle both "" and "/".</p>
<p>The value returned MUST be percent-encoded, but MUST NOT double-encode
any characters. To determine what characters to encode, please refer to
RFC 3986, Sections 2 and 3.3.</p>
<p>As an example, if the value should include a slash ("/") not intended as
delimiter between path segments, that value MUST be passed in encoded
form (e.g., "%2F") to the instance.</p>
<h4>Returns</h4>
<div class="list">
string<br>The URI path.
</div>
<h4>See</h4>
<div class="list">
https://tools.ietf.org/html/rfc3986#section-2<br>
https://tools.ietf.org/html/rfc3986#section-3.3<br>
</div>
</div>
</div></td>
</tr>
<tr data-order="getQuery" id="_getQuery">
<td class="attributes"><code>
public
string
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_getQuery">#</a>
<code><a href="source-class-Psr.Http.Message.UriInterface.html#136-156" title="Go to source code">getQuery</a>( )</code>
<div class="description short">
<p>Retrieve the query string of the URI.</p>
</div>
<div class="description detailed hidden">
<p>Retrieve the query string of the URI.</p>
<p>If no query string is present, this method MUST return an empty string.</p>
<p>The leading "?" character is not part of the query and MUST NOT be
added.</p>
<p>The value returned MUST be percent-encoded, but MUST NOT double-encode
any characters. To determine what characters to encode, please refer to
RFC 3986, Sections 2 and 3.4.</p>
<p>As an example, if a value in a key/value pair of the query string should
include an ampersand ("&") not intended as a delimiter between values,
that value MUST be passed in encoded form (e.g., "%26") to the instance.</p>
<h4>Returns</h4>
<div class="list">
string<br>The URI query string.
</div>
<h4>See</h4>
<div class="list">
https://tools.ietf.org/html/rfc3986#section-2<br>
https://tools.ietf.org/html/rfc3986#section-3.4<br>
</div>
</div>
</div></td>
</tr>
<tr data-order="getFragment" id="_getFragment">
<td class="attributes"><code>
public
string
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_getFragment">#</a>
<code><a href="source-class-Psr.Http.Message.UriInterface.html#158-174" title="Go to source code">getFragment</a>( )</code>
<div class="description short">
<p>Retrieve the fragment component of the URI.</p>
</div>
<div class="description detailed hidden">
<p>Retrieve the fragment component of the URI.</p>
<p>If no fragment is present, this method MUST return an empty string.</p>
<p>The leading "#" character is not part of the fragment and MUST NOT be
added.</p>
<p>The value returned MUST be percent-encoded, but MUST NOT double-encode
any characters. To determine what characters to encode, please refer to
RFC 3986, Sections 2 and 3.5.</p>
<h4>Returns</h4>
<div class="list">
string<br>The URI fragment.
</div>
<h4>See</h4>
<div class="list">
https://tools.ietf.org/html/rfc3986#section-2<br>
https://tools.ietf.org/html/rfc3986#section-3.5<br>
</div>
</div>
</div></td>
</tr>
<tr data-order="withScheme" id="_withScheme">
<td class="attributes"><code>
public
static
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_withScheme">#</a>
<code><a href="source-class-Psr.Http.Message.UriInterface.html#176-191" title="Go to source code">withScheme</a>( <span>string <var>$scheme</var></span> )</code>
<div class="description short">
<p>Return an instance with the specified scheme.</p>
</div>
<div class="description detailed hidden">
<p>Return an instance with the specified scheme.</p>
<p>This method MUST retain the state of the current instance, and return
an instance that contains the specified scheme.</p>
<p>Implementations MUST support the schemes "http" and "https" case
insensitively, and MAY accommodate other schemes if required.</p>
<p>An empty scheme is equivalent to removing the scheme.</p>
<h4>Parameters</h4>
<div class="list"><dl>
<dt><var>$scheme</var></dt>
<dd>The scheme to use with the new instance.</dd>
</dl></div>
<h4>Returns</h4>
<div class="list">
static<br>A new instance with the specified scheme.
</div>
<h4>Throws</h4>
<div class="list">
InvalidArgumentException<br>for invalid or unsupported schemes.
</div>
</div>
</div></td>
</tr>
<tr data-order="withUserInfo" id="_withUserInfo">
<td class="attributes"><code>
public
static
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_withUserInfo">#</a>
<code><a href="source-class-Psr.Http.Message.UriInterface.html#193-207" title="Go to source code">withUserInfo</a>( <span>string <var>$user</var></span>, <span>null|string <var>$password</var> = <span class="php-keyword1">null</span></span> )</code>
<div class="description short">
<p>Return an instance with the specified user information.</p>
</div>
<div class="description detailed hidden">
<p>Return an instance with the specified user information.</p>
<p>This method MUST retain the state of the current instance, and return
an instance that contains the specified user information.</p>
<p>Password is optional, but the user information MUST include the
user; an empty string for the user is equivalent to removing user
information.</p>
<h4>Parameters</h4>
<div class="list"><dl>
<dt><var>$user</var></dt>
<dd>The user name to use for authority.</dd>
<dt><var>$password</var></dt>
<dd>The password associated with $user.</dd>
</dl></div>
<h4>Returns</h4>
<div class="list">
static<br>A new instance with the specified user information.
</div>
</div>
</div></td>
</tr>
<tr data-order="withHost" id="_withHost">
<td class="attributes"><code>
public
static
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_withHost">#</a>
<code><a href="source-class-Psr.Http.Message.UriInterface.html#209-221" title="Go to source code">withHost</a>( <span>string <var>$host</var></span> )</code>
<div class="description short">
<p>Return an instance with the specified host.</p>
</div>
<div class="description detailed hidden">
<p>Return an instance with the specified host.</p>
<p>This method MUST retain the state of the current instance, and return
an instance that contains the specified host.</p>
<p>An empty host value is equivalent to removing the host.</p>
<h4>Parameters</h4>
<div class="list"><dl>
<dt><var>$host</var></dt>
<dd>The hostname to use with the new instance.</dd>
</dl></div>
<h4>Returns</h4>
<div class="list">
static<br>A new instance with the specified host.
</div>
<h4>Throws</h4>
<div class="list">
InvalidArgumentException<br>for invalid hostnames.
</div>
</div>
</div></td>
</tr>
<tr data-order="withPort" id="_withPort">
<td class="attributes"><code>
public
static
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_withPort">#</a>
<code><a href="source-class-Psr.Http.Message.UriInterface.html#223-240" title="Go to source code">withPort</a>( <span>null|integer <var>$port</var></span> )</code>
<div class="description short">
<p>Return an instance with the specified port.</p>
</div>
<div class="description detailed hidden">
<p>Return an instance with the specified port.</p>
<p>This method MUST retain the state of the current instance, and return
an instance that contains the specified port.</p>
<p>Implementations MUST raise an exception for ports outside the
established TCP and UDP port ranges.</p>
<p>A null value provided for the port is equivalent to removing the port
information.</p>
<h4>Parameters</h4>
<div class="list"><dl>
<dt><var>$port</var></dt>
<dd><p>The port to use with the new instance; a null value
removes the port information.</p></dd>
</dl></div>
<h4>Returns</h4>
<div class="list">
static<br>A new instance with the specified port.
</div>
<h4>Throws</h4>
<div class="list">
InvalidArgumentException<br>for invalid ports.
</div>
</div>
</div></td>
</tr>
<tr data-order="withPath" id="_withPath">
<td class="attributes"><code>
public
static
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_withPath">#</a>
<code><a href="source-class-Psr.Http.Message.UriInterface.html#242-264" title="Go to source code">withPath</a>( <span>string <var>$path</var></span> )</code>
<div class="description short">
<p>Return an instance with the specified path.</p>
</div>
<div class="description detailed hidden">
<p>Return an instance with the specified path.</p>
<p>This method MUST retain the state of the current instance, and return
an instance that contains the specified path.</p>
<p>The path can either be empty or absolute (starting with a slash) or
rootless (not starting with a slash). Implementations MUST support all
three syntaxes.</p>
<p>If the path is intended to be domain-relative rather than path relative then
it must begin with a slash ("/"). Paths not starting with a slash ("/")
are assumed to be relative to some base path known to the application or
consumer.</p>
<p>Users can provide both encoded and decoded path characters.
Implementations ensure the correct encoding as outlined in getPath().</p>
<h4>Parameters</h4>
<div class="list"><dl>
<dt><var>$path</var></dt>
<dd>The path to use with the new instance.</dd>
</dl></div>
<h4>Returns</h4>
<div class="list">
static<br>A new instance with the specified path.
</div>
<h4>Throws</h4>
<div class="list">
InvalidArgumentException<br>for invalid paths.
</div>
</div>
</div></td>
</tr>
<tr data-order="withQuery" id="_withQuery">
<td class="attributes"><code>
public
static
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_withQuery">#</a>
<code><a href="source-class-Psr.Http.Message.UriInterface.html#266-281" title="Go to source code">withQuery</a>( <span>string <var>$query</var></span> )</code>
<div class="description short">
<p>Return an instance with the specified query string.</p>
</div>
<div class="description detailed hidden">
<p>Return an instance with the specified query string.</p>
<p>This method MUST retain the state of the current instance, and return
an instance that contains the specified query string.</p>
<p>Users can provide both encoded and decoded query characters.
Implementations ensure the correct encoding as outlined in getQuery().</p>
<p>An empty query string value is equivalent to removing the query string.</p>
<h4>Parameters</h4>
<div class="list"><dl>
<dt><var>$query</var></dt>
<dd>The query string to use with the new instance.</dd>
</dl></div>
<h4>Returns</h4>
<div class="list">
static<br>A new instance with the specified query string.
</div>
<h4>Throws</h4>
<div class="list">
InvalidArgumentException<br>for invalid query strings.
</div>
</div>
</div></td>
</tr>
<tr data-order="withFragment" id="_withFragment">
<td class="attributes"><code>
public
static
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_withFragment">#</a>
<code><a href="source-class-Psr.Http.Message.UriInterface.html#283-297" title="Go to source code">withFragment</a>( <span>string <var>$fragment</var></span> )</code>
<div class="description short">
<p>Return an instance with the specified URI fragment.</p>
</div>
<div class="description detailed hidden">
<p>Return an instance with the specified URI fragment.</p>
<p>This method MUST retain the state of the current instance, and return
an instance that contains the specified URI fragment.</p>
<p>Users can provide both encoded and decoded fragment characters.
Implementations ensure the correct encoding as outlined in getFragment().</p>
<p>An empty fragment value is equivalent to removing the fragment.</p>
<h4>Parameters</h4>
<div class="list"><dl>
<dt><var>$fragment</var></dt>
<dd>The fragment to use with the new instance.</dd>
</dl></div>
<h4>Returns</h4>
<div class="list">
static<br>A new instance with the specified fragment.
</div>
</div>
</div></td>
</tr>
<tr data-order="__toString" id="___toString">
<td class="attributes"><code>
public
string
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#___toString">#</a>
<code><a href="source-class-Psr.Http.Message.UriInterface.html#299-322" title="Go to source code">__toString</a>( )</code>
<div class="description short">
<p>Return the string representation as a URI reference.</p>
</div>
<div class="description detailed hidden">
<p>Return the string representation as a URI reference.</p>
<p>Depending on which components of the URI are present, the resulting
string is either a full URI or relative reference according to RFC 3986,
Section 4.1. The method concatenates the various components of the URI,
using the appropriate delimiters:</p>
<ul>
<li>If a scheme is present, it MUST be suffixed by ":".</li>
<li>If an authority is present, it MUST be prefixed by "//".</li>
<li>The path can be concatenated without delimiters. But there are two cases where the path has to be adjusted to make the URI reference valid as PHP does not allow to throw an exception in __toString(): - If the path is rootless and an authority is present, the path MUST be prefixed by "/". - If the path is starting with more than one "/" and no authority is present, the starting slashes MUST be reduced to one.</li>
<li>If a query is present, it MUST be prefixed by "?".</li>
<li>If a fragment is present, it MUST be prefixed by "#".</li>
</ul>
<h4>Returns</h4>
<div class="list">
string
</div>
<h4>See</h4>
<div class="list">
http://tools.ietf.org/html/rfc3986#section-4.1<br>
</div>
</div>
</div></td>
</tr>
</table>
</div>
<div id="footer">
ξ ^ω^)ξ Baguette PHP Mastodon API Client / SDK API documentation generated by <a href="http://apigen.org">ApiGen</a>
</div>
</div>
</div>
<script src="resources/combined.js"></script>
<script src="elementlist.js"></script>
</body>
</html>