|
2 | 2 | namespace Psr\Http\Message; |
3 | 3 |
|
4 | 4 | /** |
5 | | - * Value object representing the request target, and typically a URI. |
| 5 | + * Value object representing a URI for use in HTTP requests. |
| 6 | + * |
| 7 | + * This interface is meant to represent only URIs for use with HTTP requests, |
| 8 | + * and is not intended as a general-purpose URI implementation. |
6 | 9 | * |
7 | 10 | * Instances of this interface are considered immutable; all methods that |
8 | 11 | * might change state MUST be implemented such that they retain the internal |
9 | 12 | * state of the current instance and return a new instance that contains the |
10 | 13 | * changed state. |
11 | 14 | * |
12 | | - * Since this interface represents a request target per RFC 7230, the instance |
13 | | - * MAY represent an absolute URI OR one of the request targets that are not |
14 | | - * fully qualified URIs, including origin-form, authority-form, or |
15 | | - * asterisk-form. As such, test methods exist for determining what request |
16 | | - * target form is in use: |
17 | | - * |
18 | | - * - isAbsolute() tests if the target is in absolute-form (minimally scheme + |
19 | | - * authority). |
20 | | - * - isOrigin() tests if the target is in origin-form (path + optional query |
21 | | - * string only). |
22 | | - * - isAuthority() tests if the target contains the authority only. |
23 | | - * - isAsterisk() tests if the entirety of the target is '*'. |
24 | | - * |
25 | | - * These target forms are included, as they are valid forms for use with an |
26 | | - * HTTP request, and will appear without other URI segments available within |
27 | | - * the request line. This interface models the target as it appears in the |
28 | | - * incoming request line or as it will be emitted by a client. |
29 | | - * |
30 | | - * Typically, for all forms other than absolute-form, minimally the Host header |
31 | | - * will be also be present in the request message. For server-side requests, |
32 | | - * the scheme will typically be discoverable in the server parameters. |
| 15 | + * Typically the Host header will be also be present in the request message. |
| 16 | + * For server-side requests, the scheme will typically be discoverable in the |
| 17 | + * server parameters. |
33 | 18 | * |
34 | 19 | * @link http://tools.ietf.org/html/rfc3986 (the URI specification) |
35 | | - * @link http://tools.ietf.org/html/rfc7230#section-2.7 (URIs as used in the HTTP specification) |
36 | 20 | */ |
37 | | -interface UriTargetInterface |
| 21 | +interface UriInterface |
38 | 22 | { |
39 | 23 | /** |
40 | 24 | * Retrieve the URI scheme. |
@@ -262,52 +246,6 @@ public function withQuery($query); |
262 | 246 | */ |
263 | 247 | public function withFragment($fragment); |
264 | 248 |
|
265 | | - /** |
266 | | - * Indicate whether the URI is in origin-form. |
267 | | - * |
268 | | - * Origin-form is a URI that includes only the path, and optionally the |
269 | | - * query string. |
270 | | - * |
271 | | - * @link http://tools.ietf.org/html/rfc7230#section-5.3.1 |
272 | | - * @return bool |
273 | | - */ |
274 | | - public function isOrigin(); |
275 | | - |
276 | | - /** |
277 | | - * Indicate whether the URI is absolute. |
278 | | - * |
279 | | - * An absolute URI contains minimally a non-empty scheme and non-empty |
280 | | - * authority. |
281 | | - * |
282 | | - * @see getAuthority() |
283 | | - * @link http://tools.ietf.org/html/rfc7230#section-5.3.2 |
284 | | - * @return bool |
285 | | - */ |
286 | | - public function isAbsolute(); |
287 | | - |
288 | | - /** |
289 | | - * Indicate whether the instance represents an authority-form request |
290 | | - * target. |
291 | | - * |
292 | | - * An authority-form request-target contains ONLY the authority information. |
293 | | - * |
294 | | - * @see getAuthority() |
295 | | - * @link http://tools.ietf.org/html/rfc7230#section-5.3.3 |
296 | | - * @return bool |
297 | | - */ |
298 | | - public function isAuthority(); |
299 | | - |
300 | | - /** |
301 | | - * Indicate whether the instance represents an asterisk-form request |
302 | | - * target. |
303 | | - * |
304 | | - * An asterisk-form request-target will contain ONLY the string "*". |
305 | | - * |
306 | | - * @link http://tools.ietf.org/html/rfc7230#section-5.3.4 |
307 | | - * @return bool |
308 | | - */ |
309 | | - public function isAsterisk(); |
310 | | - |
311 | 249 | /** |
312 | 250 | * Return the string representation of the URI. |
313 | 251 | * |
|
0 commit comments