1
1
<?php
2
+
3
+ declare (strict_types=1 );
4
+
2
5
namespace Psr \Http \Message ;
3
6
4
7
/**
@@ -188,7 +191,7 @@ public function getFragment();
188
191
* @return static A new instance with the specified scheme.
189
192
* @throws \InvalidArgumentException for invalid or unsupported schemes.
190
193
*/
191
- public function withScheme ($ scheme );
194
+ public function withScheme (string $ scheme );
192
195
193
196
/**
194
197
* Return an instance with the specified user information.
@@ -204,7 +207,7 @@ public function withScheme($scheme);
204
207
* @param null|string $password The password associated with $user.
205
208
* @return static A new instance with the specified user information.
206
209
*/
207
- public function withUserInfo ($ user , $ password = null );
210
+ public function withUserInfo (string $ user , ? string $ password = null );
208
211
209
212
/**
210
213
* Return an instance with the specified host.
@@ -218,7 +221,7 @@ public function withUserInfo($user, $password = null);
218
221
* @return static A new instance with the specified host.
219
222
* @throws \InvalidArgumentException for invalid hostnames.
220
223
*/
221
- public function withHost ($ host );
224
+ public function withHost (string $ host );
222
225
223
226
/**
224
227
* Return an instance with the specified port.
@@ -237,7 +240,7 @@ public function withHost($host);
237
240
* @return static A new instance with the specified port.
238
241
* @throws \InvalidArgumentException for invalid ports.
239
242
*/
240
- public function withPort ($ port );
243
+ public function withPort (? int $ port );
241
244
242
245
/**
243
246
* Return an instance with the specified path.
@@ -261,7 +264,7 @@ public function withPort($port);
261
264
* @return static A new instance with the specified path.
262
265
* @throws \InvalidArgumentException for invalid paths.
263
266
*/
264
- public function withPath ($ path );
267
+ public function withPath (string $ path );
265
268
266
269
/**
267
270
* Return an instance with the specified query string.
@@ -278,7 +281,7 @@ public function withPath($path);
278
281
* @return static A new instance with the specified query string.
279
282
* @throws \InvalidArgumentException for invalid query strings.
280
283
*/
281
- public function withQuery ($ query );
284
+ public function withQuery (string $ query );
282
285
283
286
/**
284
287
* Return an instance with the specified URI fragment.
@@ -294,7 +297,7 @@ public function withQuery($query);
294
297
* @param string $fragment The fragment to use with the new instance.
295
298
* @return static A new instance with the specified fragment.
296
299
*/
297
- public function withFragment ($ fragment );
300
+ public function withFragment (string $ fragment );
298
301
299
302
/**
300
303
* Return the string representation as a URI reference.
0 commit comments