11<?php
2+
3+ declare (strict_types=1 );
4+
25namespace Psr \Http \Message ;
36
47/**
@@ -188,7 +191,7 @@ public function getFragment();
188191 * @return static A new instance with the specified scheme.
189192 * @throws \InvalidArgumentException for invalid or unsupported schemes.
190193 */
191- public function withScheme ($ scheme );
194+ public function withScheme (string $ scheme );
192195
193196 /**
194197 * Return an instance with the specified user information.
@@ -204,7 +207,7 @@ public function withScheme($scheme);
204207 * @param null|string $password The password associated with $user.
205208 * @return static A new instance with the specified user information.
206209 */
207- public function withUserInfo ($ user , $ password = null );
210+ public function withUserInfo (string $ user , ? string $ password = null );
208211
209212 /**
210213 * Return an instance with the specified host.
@@ -218,7 +221,7 @@ public function withUserInfo($user, $password = null);
218221 * @return static A new instance with the specified host.
219222 * @throws \InvalidArgumentException for invalid hostnames.
220223 */
221- public function withHost ($ host );
224+ public function withHost (string $ host );
222225
223226 /**
224227 * Return an instance with the specified port.
@@ -237,7 +240,7 @@ public function withHost($host);
237240 * @return static A new instance with the specified port.
238241 * @throws \InvalidArgumentException for invalid ports.
239242 */
240- public function withPort ($ port );
243+ public function withPort (? int $ port );
241244
242245 /**
243246 * Return an instance with the specified path.
@@ -261,7 +264,7 @@ public function withPort($port);
261264 * @return static A new instance with the specified path.
262265 * @throws \InvalidArgumentException for invalid paths.
263266 */
264- public function withPath ($ path );
267+ public function withPath (string $ path );
265268
266269 /**
267270 * Return an instance with the specified query string.
@@ -278,7 +281,7 @@ public function withPath($path);
278281 * @return static A new instance with the specified query string.
279282 * @throws \InvalidArgumentException for invalid query strings.
280283 */
281- public function withQuery ($ query );
284+ public function withQuery (string $ query );
282285
283286 /**
284287 * Return an instance with the specified URI fragment.
@@ -294,7 +297,7 @@ public function withQuery($query);
294297 * @param string $fragment The fragment to use with the new instance.
295298 * @return static A new instance with the specified fragment.
296299 */
297- public function withFragment ($ fragment );
300+ public function withFragment (string $ fragment );
298301
299302 /**
300303 * Return the string representation as a URI reference.
0 commit comments