PluginProbe ʕ •ᴥ•ʔ
Independent Analytics – WordPress Analytics Plugin / 1.30.0
Independent Analytics – WordPress Analytics Plugin v1.30.0
2.15.5 2.15.4 2.15.3 2.15.2 2.15.1 2.15.0 2.14.10 trunk 1.1 1.10 1.10.1 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.17.1 1.17.2 1.17.3 1.17.4 1.18 1.18.1 1.19.0 1.19.1 1.2 1.20.0 1.21.0 1.22.0 1.22.1 1.23.0 1.23.1 1.24.0 1.24.1 1.25.0 1.25.1 1.26.0 1.27.0 1.28.0 1.28.1 1.28.2 1.28.3 1.29.0 1.3 1.30.0 1.30.1 1.4 1.5 1.6 1.7 1.8 1.9 2.0.0 2.0.1 2.1.4 2.1.5 2.1.6 2.10.0 2.10.1 2.10.2 2.10.3 2.10.4 2.11.0 2.11.1 2.11.10 2.11.2 2.11.3 2.11.4 2.11.5 2.11.6 2.11.7 2.11.8 2.11.9 2.12.0 2.12.1 2.12.2 2.13.1 2.13.2 2.13.5 2.13.6 2.14.0 2.14.1 2.14.2 2.14.4 2.14.6 2.14.7 2.14.8 2.14.9 2.2.0 2.2.1 2.3.1 2.3.2 2.4.2 2.4.3 2.5.0 2.5.1 2.6.0 2.6.1 2.6.2 2.6.3 2.6.4 2.7.0 2.7.1 2.7.2 2.7.3 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.8 2.8.9 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7
independent-analytics / vendor / psr / http-message / src / UriInterface.php
independent-analytics / vendor / psr / http-message / src Last commit date
MessageInterface.php 3 years ago RequestInterface.php 3 years ago ResponseInterface.php 3 years ago ServerRequestInterface.php 3 years ago StreamInterface.php 3 years ago UploadedFileInterface.php 3 years ago UriInterface.php 3 years ago
UriInterface.php
311 lines
1 <?php
2
3 declare (strict_types=1);
4 namespace IAWP_SCOPED\Psr\Http\Message;
5
6 /**
7 * Value object representing a URI.
8 *
9 * This interface is meant to represent URIs according to RFC 3986 and to
10 * provide methods for most common operations. Additional functionality for
11 * working with URIs can be provided on top of the interface or externally.
12 * Its primary use is for HTTP requests, but may also be used in other
13 * contexts.
14 *
15 * Instances of this interface are considered immutable; all methods that
16 * might change state MUST be implemented such that they retain the internal
17 * state of the current instance and return an instance that contains the
18 * changed state.
19 *
20 * Typically the Host header will be also be present in the request message.
21 * For server-side requests, the scheme will typically be discoverable in the
22 * server parameters.
23 *
24 * @link http://tools.ietf.org/html/rfc3986 (the URI specification)
25 */
26 interface UriInterface
27 {
28 /**
29 * Retrieve the scheme component of the URI.
30 *
31 * If no scheme is present, this method MUST return an empty string.
32 *
33 * The value returned MUST be normalized to lowercase, per RFC 3986
34 * Section 3.1.
35 *
36 * The trailing ":" character is not part of the scheme and MUST NOT be
37 * added.
38 *
39 * @see https://tools.ietf.org/html/rfc3986#section-3.1
40 * @return string The URI scheme.
41 */
42 public function getScheme();
43 /**
44 * Retrieve the authority component of the URI.
45 *
46 * If no authority information is present, this method MUST return an empty
47 * string.
48 *
49 * The authority syntax of the URI is:
50 *
51 * <pre>
52 * [user-info@]host[:port]
53 * </pre>
54 *
55 * If the port component is not set or is the standard port for the current
56 * scheme, it SHOULD NOT be included.
57 *
58 * @see https://tools.ietf.org/html/rfc3986#section-3.2
59 * @return string The URI authority, in "[user-info@]host[:port]" format.
60 */
61 public function getAuthority();
62 /**
63 * Retrieve the user information component of the URI.
64 *
65 * If no user information is present, this method MUST return an empty
66 * string.
67 *
68 * If a user is present in the URI, this will return that value;
69 * additionally, if the password is also present, it will be appended to the
70 * user value, with a colon (":") separating the values.
71 *
72 * The trailing "@" character is not part of the user information and MUST
73 * NOT be added.
74 *
75 * @return string The URI user information, in "username[:password]" format.
76 */
77 public function getUserInfo();
78 /**
79 * Retrieve the host component of the URI.
80 *
81 * If no host is present, this method MUST return an empty string.
82 *
83 * The value returned MUST be normalized to lowercase, per RFC 3986
84 * Section 3.2.2.
85 *
86 * @see http://tools.ietf.org/html/rfc3986#section-3.2.2
87 * @return string The URI host.
88 */
89 public function getHost();
90 /**
91 * Retrieve the port component of the URI.
92 *
93 * If a port is present, and it is non-standard for the current scheme,
94 * this method MUST return it as an integer. If the port is the standard port
95 * used with the current scheme, this method SHOULD return null.
96 *
97 * If no port is present, and no scheme is present, this method MUST return
98 * a null value.
99 *
100 * If no port is present, but a scheme is present, this method MAY return
101 * the standard port for that scheme, but SHOULD return null.
102 *
103 * @return null|int The URI port.
104 */
105 public function getPort();
106 /**
107 * Retrieve the path component of the URI.
108 *
109 * The path can either be empty or absolute (starting with a slash) or
110 * rootless (not starting with a slash). Implementations MUST support all
111 * three syntaxes.
112 *
113 * Normally, the empty path "" and absolute path "/" are considered equal as
114 * defined in RFC 7230 Section 2.7.3. But this method MUST NOT automatically
115 * do this normalization because in contexts with a trimmed base path, e.g.
116 * the front controller, this difference becomes significant. It's the task
117 * of the user to handle both "" and "/".
118 *
119 * The value returned MUST be percent-encoded, but MUST NOT double-encode
120 * any characters. To determine what characters to encode, please refer to
121 * RFC 3986, Sections 2 and 3.3.
122 *
123 * As an example, if the value should include a slash ("/") not intended as
124 * delimiter between path segments, that value MUST be passed in encoded
125 * form (e.g., "%2F") to the instance.
126 *
127 * @see https://tools.ietf.org/html/rfc3986#section-2
128 * @see https://tools.ietf.org/html/rfc3986#section-3.3
129 * @return string The URI path.
130 */
131 public function getPath();
132 /**
133 * Retrieve the query string of the URI.
134 *
135 * If no query string is present, this method MUST return an empty string.
136 *
137 * The leading "?" character is not part of the query and MUST NOT be
138 * added.
139 *
140 * The value returned MUST be percent-encoded, but MUST NOT double-encode
141 * any characters. To determine what characters to encode, please refer to
142 * RFC 3986, Sections 2 and 3.4.
143 *
144 * As an example, if a value in a key/value pair of the query string should
145 * include an ampersand ("&") not intended as a delimiter between values,
146 * that value MUST be passed in encoded form (e.g., "%26") to the instance.
147 *
148 * @see https://tools.ietf.org/html/rfc3986#section-2
149 * @see https://tools.ietf.org/html/rfc3986#section-3.4
150 * @return string The URI query string.
151 */
152 public function getQuery();
153 /**
154 * Retrieve the fragment component of the URI.
155 *
156 * If no fragment is present, this method MUST return an empty string.
157 *
158 * The leading "#" character is not part of the fragment and MUST NOT be
159 * added.
160 *
161 * The value returned MUST be percent-encoded, but MUST NOT double-encode
162 * any characters. To determine what characters to encode, please refer to
163 * RFC 3986, Sections 2 and 3.5.
164 *
165 * @see https://tools.ietf.org/html/rfc3986#section-2
166 * @see https://tools.ietf.org/html/rfc3986#section-3.5
167 * @return string The URI fragment.
168 */
169 public function getFragment();
170 /**
171 * Return an instance with the specified scheme.
172 *
173 * This method MUST retain the state of the current instance, and return
174 * an instance that contains the specified scheme.
175 *
176 * Implementations MUST support the schemes "http" and "https" case
177 * insensitively, and MAY accommodate other schemes if required.
178 *
179 * An empty scheme is equivalent to removing the scheme.
180 *
181 * @param string $scheme The scheme to use with the new instance.
182 * @return static A new instance with the specified scheme.
183 * @throws \InvalidArgumentException for invalid or unsupported schemes.
184 */
185 public function withScheme(string $scheme);
186 /**
187 * Return an instance with the specified user information.
188 *
189 * This method MUST retain the state of the current instance, and return
190 * an instance that contains the specified user information.
191 *
192 * Password is optional, but the user information MUST include the
193 * user; an empty string for the user is equivalent to removing user
194 * information.
195 *
196 * @param string $user The user name to use for authority.
197 * @param null|string $password The password associated with $user.
198 * @return static A new instance with the specified user information.
199 */
200 public function withUserInfo(string $user, ?string $password = null);
201 /**
202 * Return an instance with the specified host.
203 *
204 * This method MUST retain the state of the current instance, and return
205 * an instance that contains the specified host.
206 *
207 * An empty host value is equivalent to removing the host.
208 *
209 * @param string $host The hostname to use with the new instance.
210 * @return static A new instance with the specified host.
211 * @throws \InvalidArgumentException for invalid hostnames.
212 */
213 public function withHost(string $host);
214 /**
215 * Return an instance with the specified port.
216 *
217 * This method MUST retain the state of the current instance, and return
218 * an instance that contains the specified port.
219 *
220 * Implementations MUST raise an exception for ports outside the
221 * established TCP and UDP port ranges.
222 *
223 * A null value provided for the port is equivalent to removing the port
224 * information.
225 *
226 * @param null|int $port The port to use with the new instance; a null value
227 * removes the port information.
228 * @return static A new instance with the specified port.
229 * @throws \InvalidArgumentException for invalid ports.
230 */
231 public function withPort(?int $port);
232 /**
233 * Return an instance with the specified path.
234 *
235 * This method MUST retain the state of the current instance, and return
236 * an instance that contains the specified path.
237 *
238 * The path can either be empty or absolute (starting with a slash) or
239 * rootless (not starting with a slash). Implementations MUST support all
240 * three syntaxes.
241 *
242 * If the path is intended to be domain-relative rather than path relative then
243 * it must begin with a slash ("/"). Paths not starting with a slash ("/")
244 * are assumed to be relative to some base path known to the application or
245 * consumer.
246 *
247 * Users can provide both encoded and decoded path characters.
248 * Implementations ensure the correct encoding as outlined in getPath().
249 *
250 * @param string $path The path to use with the new instance.
251 * @return static A new instance with the specified path.
252 * @throws \InvalidArgumentException for invalid paths.
253 */
254 public function withPath(string $path);
255 /**
256 * Return an instance with the specified query string.
257 *
258 * This method MUST retain the state of the current instance, and return
259 * an instance that contains the specified query string.
260 *
261 * Users can provide both encoded and decoded query characters.
262 * Implementations ensure the correct encoding as outlined in getQuery().
263 *
264 * An empty query string value is equivalent to removing the query string.
265 *
266 * @param string $query The query string to use with the new instance.
267 * @return static A new instance with the specified query string.
268 * @throws \InvalidArgumentException for invalid query strings.
269 */
270 public function withQuery(string $query);
271 /**
272 * Return an instance with the specified URI fragment.
273 *
274 * This method MUST retain the state of the current instance, and return
275 * an instance that contains the specified URI fragment.
276 *
277 * Users can provide both encoded and decoded fragment characters.
278 * Implementations ensure the correct encoding as outlined in getFragment().
279 *
280 * An empty fragment value is equivalent to removing the fragment.
281 *
282 * @param string $fragment The fragment to use with the new instance.
283 * @return static A new instance with the specified fragment.
284 */
285 public function withFragment(string $fragment);
286 /**
287 * Return the string representation as a URI reference.
288 *
289 * Depending on which components of the URI are present, the resulting
290 * string is either a full URI or relative reference according to RFC 3986,
291 * Section 4.1. The method concatenates the various components of the URI,
292 * using the appropriate delimiters:
293 *
294 * - If a scheme is present, it MUST be suffixed by ":".
295 * - If an authority is present, it MUST be prefixed by "//".
296 * - The path can be concatenated without delimiters. But there are two
297 * cases where the path has to be adjusted to make the URI reference
298 * valid as PHP does not allow to throw an exception in __toString():
299 * - If the path is rootless and an authority is present, the path MUST
300 * be prefixed by "/".
301 * - If the path is starting with more than one "/" and no authority is
302 * present, the starting slashes MUST be reduced to one.
303 * - If a query is present, it MUST be prefixed by "?".
304 * - If a fragment is present, it MUST be prefixed by "#".
305 *
306 * @see http://tools.ietf.org/html/rfc3986#section-4.1
307 * @return string
308 */
309 public function __toString();
310 }
311