Commit 754d423
committed
Normalized to follow original URI proposal
See https://github.com/php-fig/fig-standards/blob/3486dc9184e9a099118389cd3e032295852d011e/proposed/uri.md
I examined this proposal, as well as looked in depth at RFC's 3986 and
7230 to see what overlap we had and/or needed. The interface in its
current form now is mostly compatible with the original proposal. It
differs in the following ways:
- Since this proposal targets HTTP requests specifically, I did not
separate URI vs Hierarchical URI vs Opaque.
- This proposal combines aspects of the originally proposed UriInterface
and the HierarchicalUriInterface, particularly around the various
getters.
- I have omitted the `to(Encoded|Decoded)String()` methods, as they are
essentially irrelevant for HTTP messages (requests will always want
decoded URIs).
- I have omitted `getQueryAsArray()` as I'm not 100% sold on their
efficacy for HTTP messages, particularly as ServerRequest already
defines `getQueryParams()`
- I omitted `getHierarchicalPart()`, as I could not find a use case
within the domain of HTTP messages.
- I omitted `normalize()`, `resolve()`, and `relativize()` as I did not
have immediate use cases for them with regards to HTTP messages. They
may be useful for HTTP clients, however.
- I modified `getAuthority()` to return the authority segment of a URI.
- I added `getUserInfo()` to perform what `getAuthority()` was doing
previously, and renamed `withAuthority()` to `withUserInfo()`.
With the changes made, an implementation that bridges the original
interfaces and those in this proposal can be made that are 100%
compatible.1 parent 77ba53d commit 754d423
1 file changed
+37
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
| 30 | + | |
35 | 31 | | |
36 | | - | |
37 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
47 | 61 | | |
48 | 62 | | |
49 | 63 | | |
| |||
119 | 133 | | |
120 | 134 | | |
121 | 135 | | |
122 | | - | |
| 136 | + | |
123 | 137 | | |
124 | 138 | | |
125 | | - | |
| 139 | + | |
126 | 140 | | |
127 | | - | |
| 141 | + | |
128 | 142 | | |
129 | 143 | | |
130 | 144 | | |
131 | 145 | | |
132 | | - | |
| 146 | + | |
133 | 147 | | |
134 | 148 | | |
135 | | - | |
| 149 | + | |
136 | 150 | | |
137 | 151 | | |
138 | 152 | | |
| |||
208 | 222 | | |
209 | 223 | | |
210 | 224 | | |
| 225 | + | |
211 | 226 | | |
212 | 227 | | |
213 | | - | |
| 228 | + | |
214 | 229 | | |
215 | 230 | | |
216 | 231 | | |
217 | 232 | | |
218 | 233 | | |
219 | 234 | | |
| 235 | + | |
220 | 236 | | |
221 | 237 | | |
222 | | - | |
| 238 | + | |
223 | 239 | | |
224 | 240 | | |
225 | 241 | | |
226 | 242 | | |
227 | 243 | | |
228 | 244 | | |
229 | 245 | | |
| 246 | + | |
230 | 247 | | |
231 | 248 | | |
232 | | - | |
| 249 | + | |
233 | 250 | | |
234 | 251 | | |
235 | | - | |
| 252 | + | |
236 | 253 | | |
237 | | - | |
| 254 | + | |
238 | 255 | | |
| 256 | + | |
239 | 257 | | |
240 | 258 | | |
241 | | - | |
| 259 | + | |
242 | 260 | | |
243 | 261 | | |
244 | 262 | | |
| |||
0 commit comments