Skip to content

Commit 07ba2d5

Browse files
committed
Provide more and better description of the interface
Indicated that this interface _typically_ represents a URI, but technically represents a request target per 7230.
1 parent 604bc8a commit 07ba2d5

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

src/UriInterface.php

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,31 @@
22
namespace Psr\Http\Message;
33

44
/**
5-
* Value object representing a URI.
5+
* Value object representing the request target, and typically a URI.
66
*
7-
* URIs are considered immutable; all methods that might change state MUST
8-
* be implemented such that they retain the internal state of the current
9-
* instance and return a new instance that contains the changed state.
7+
* Instances of this interface are considered immutable; all methods that
8+
* might change state MUST be implemented such that they retain the internal
9+
* state of the current instance and return a new instance that contains the
10+
* changed state.
11+
*
12+
* Since this interface represents a request target per RFC 7230, the instance
13+
* can potentially omit the scheme and authority. As such, test methods exist
14+
* for determining what request target form is in use:
15+
*
16+
* - isOrigin() tests if the target is in origin-form (path + optional query
17+
* string only).
18+
* - isAbsolute() tests if the target is in absolute-form (minimally scheme +
19+
* authority).
20+
* - isAuthority() tests if the target contains the authority only.
21+
* - isAsterisk() tests if the entirety of the target is '*'.
22+
*
23+
* These target forms are included, as they are valid forms for use with an
24+
* HTTP request, and will appear without other URI segments available within
25+
* the request line. This interface models the target as it appears.
26+
*
27+
* Typically, for all forms other than absolute-form, minimally the Host header
28+
* will be also be present in the request message. For server-side requests,
29+
* the scheme will typically be discoverable in the server parameters.
1030
*
1131
* @link http://tools.ietf.org/html/rfc3986 (the URI specification)
1232
* @link http://tools.ietf.org/html/rfc7230#section-2.7 (URIs as used in the HTTP specification)

0 commit comments

Comments
 (0)