Skip to content

Commit 9ffea55

Browse files
committed
Update to weierophinney/fig-standards#af606e5
- Updates to `s/BaseUrl/AbsoluteUri/`.
1 parent fa164e0 commit 9ffea55

File tree

1 file changed

+28
-21
lines changed

1 file changed

+28
-21
lines changed

src/RequestInterface.php

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -41,50 +41,54 @@ public function getMethod();
4141
public function setMethod($method);
4242

4343
/**
44-
* Retrieves the base request URL.
44+
* Retrieves the absolute URI.
4545
*
46-
* The base URL consists of:
46+
* An absolute URI consists of minimally scheme and host, but can also
47+
* contain:
4748
*
48-
* - scheme
49-
* - authentication (if any)
50-
* - server name/host
49+
* - authentication (user/pass) if provided
5150
* - port (if non-standard)
51+
* - path (if any)
52+
* - query string (if present)
53+
* - fragment (if present)
5254
*
53-
* This method is provided for convenience, particularly when considering
54-
* server-side requests, where data such as the scheme and server name may
55-
* need to be computed from more than one environmental variable.
55+
* If either of the scheme or host are not present, this method MUST return
56+
* null.
5657
*
5758
* @link http://tools.ietf.org/html/rfc3986#section-4.3
58-
* @return string Returns the base URL as a string. The URL MUST include
59-
* the scheme and host; if the port is non-standard for the scheme,
60-
* the port MUST be included; authentication data MAY be provided.
59+
* @return string|null Returns the absolute URL as a string. The URL MUST
60+
* include the scheme and host; if the port is non-standard for the
61+
* scheme, the port MUST be included; authentication data MAY be
62+
* provided. If either host or scheme are missing, this method MUST
63+
* return null.
6164
*/
62-
public function getBaseUrl();
65+
public function getAbsoluteUri();
6366

6467
/**
65-
* Sets the base request URL.
68+
* Sets the absolute URI of the request.
6669
*
67-
* The base URL MUST be a string, and MUST include the scheme and host.
70+
* The absolute URI MUST be a string, and MUST include the scheme and host.
6871
*
6972
* If the port is non-standard for the scheme, the port MUST be provided.
7073
*
7174
* Authentication data MAY be provided.
7275
*
73-
* If path, query string, or URL fragment are provided they SHOULD be
74-
* stripped; optionally, an error MAY be raised in such situations.
76+
* Path, query string, and fragment are optional.
77+
*
78+
* When setting the absolute URI, the url (see getUrl() and setUrl()) MUST
79+
* be updated.
7580
*
7681
* @link http://tools.ietf.org/html/rfc3986#section-4.3
77-
* @param string $url Base request URL.
82+
* @param string $uri Absolute request URI.
7883
* @return void
79-
* @throws \InvalidArgumentException If the URL is invalid.
84+
* @throws \InvalidArgumentException If the URI is invalid.
8085
*/
81-
public function setBaseUrl($url);
86+
public function setAbsoluteUri($uri);
8287

8388
/**
8489
* Retrieves the request URL.
8590
*
86-
* The request URL is the same value as REQUEST_URI: the path and query
87-
* string ONLY.
91+
* The request URL is the path and query string ONLY.
8892
*
8993
* @link http://tools.ietf.org/html/rfc7230#section-5.3
9094
* @return string Returns the URL as a string. The URL MUST be an
@@ -99,6 +103,9 @@ public function getUrl();
99103
* string) per RFC 7230 section 5.3; if other URL parts are present, the
100104
* method MUST raise an exception OR remove those parts.
101105
*
106+
* When setting the URL, the absolute URI (see getAbsoluteUri() and
107+
* setAbsoluteUri()) MUST be updated.
108+
*
102109
* @link http://tools.ietf.org/html/rfc7230#section-5.3
103110
* @param string $url Request URL, with path and optionally query string.
104111
* @return void

0 commit comments

Comments
 (0)