Skip to content

Commit 14b9b81

Browse files
committed
Merge pull request #50 from localheinz/fix/return
Fix: Return static instead of self * localheinz/fix/return: Fix: Return static instead of self
2 parents d0aabc0 + a6764a4 commit 14b9b81

5 files changed

+22
-22
lines changed

src/MessageInterface.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function getProtocolVersion();
3636
* new protocol version.
3737
*
3838
* @param string $version HTTP protocol version
39-
* @return self
39+
* @return static
4040
*/
4141
public function withProtocolVersion($version);
4242

@@ -126,7 +126,7 @@ public function getHeaderLine($name);
126126
*
127127
* @param string $name Case-insensitive header field name.
128128
* @param string|string[] $value Header value(s).
129-
* @return self
129+
* @return static
130130
* @throws \InvalidArgumentException for invalid header names or values.
131131
*/
132132
public function withHeader($name, $value);
@@ -144,7 +144,7 @@ public function withHeader($name, $value);
144144
*
145145
* @param string $name Case-insensitive header field name to add.
146146
* @param string|string[] $value Header value(s).
147-
* @return self
147+
* @return static
148148
* @throws \InvalidArgumentException for invalid header names or values.
149149
*/
150150
public function withAddedHeader($name, $value);
@@ -159,7 +159,7 @@ public function withAddedHeader($name, $value);
159159
* the named header.
160160
*
161161
* @param string $name Case-insensitive header field name to remove.
162-
* @return self
162+
* @return static
163163
*/
164164
public function withoutHeader($name);
165165

@@ -180,7 +180,7 @@ public function getBody();
180180
* new body stream.
181181
*
182182
* @param StreamInterface $body Body.
183-
* @return self
183+
* @return static
184184
* @throws \InvalidArgumentException When the body is not valid.
185185
*/
186186
public function withBody(StreamInterface $body);

src/RequestInterface.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function getRequestTarget();
5656
* @link http://tools.ietf.org/html/rfc7230#section-5.3 (for the various
5757
* request-target forms allowed in request messages)
5858
* @param mixed $requestTarget
59-
* @return self
59+
* @return static
6060
*/
6161
public function withRequestTarget($requestTarget);
6262

@@ -79,7 +79,7 @@ public function getMethod();
7979
* changed request method.
8080
*
8181
* @param string $method Case-sensitive method.
82-
* @return self
82+
* @return static
8383
* @throws \InvalidArgumentException for invalid HTTP methods.
8484
*/
8585
public function withMethod($method);
@@ -123,7 +123,7 @@ public function getUri();
123123
* @link http://tools.ietf.org/html/rfc3986#section-4.3
124124
* @param UriInterface $uri New request URI to use.
125125
* @param bool $preserveHost Preserve the original state of the Host header.
126-
* @return self
126+
* @return static
127127
*/
128128
public function withUri(UriInterface $uri, $preserveHost = false);
129129
}

src/ResponseInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function getStatusCode();
4646
* @param string $reasonPhrase The reason phrase to use with the
4747
* provided status code; if none is provided, implementations MAY
4848
* use the defaults as suggested in the HTTP specification.
49-
* @return self
49+
* @return static
5050
* @throws \InvalidArgumentException For invalid status code arguments.
5151
*/
5252
public function withStatus($code, $reasonPhrase = '');

src/ServerRequestInterface.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function getCookieParams();
8080
* updated cookie values.
8181
*
8282
* @param array $cookies Array of key/value pairs representing cookies.
83-
* @return self
83+
* @return static
8484
*/
8585
public function withCookieParams(array $cookies);
8686

@@ -118,7 +118,7 @@ public function getQueryParams();
118118
*
119119
* @param array $query Array of query string arguments, typically from
120120
* $_GET.
121-
* @return self
121+
* @return static
122122
*/
123123
public function withQueryParams(array $query);
124124

@@ -144,7 +144,7 @@ public function getUploadedFiles();
144144
* updated body parameters.
145145
*
146146
* @param array $uploadedFiles An array tree of UploadedFileInterface instances.
147-
* @return self
147+
* @return static
148148
* @throws \InvalidArgumentException if an invalid structure is provided.
149149
*/
150150
public function withUploadedFiles(array $uploadedFiles);
@@ -190,7 +190,7 @@ public function getParsedBody();
190190
*
191191
* @param null|array|object $data The deserialized body data. This will
192192
* typically be in an array or object.
193-
* @return self
193+
* @return static
194194
* @throws \InvalidArgumentException if an unsupported argument type is
195195
* provided.
196196
*/
@@ -239,7 +239,7 @@ public function getAttribute($name, $default = null);
239239
* @see getAttributes()
240240
* @param string $name The attribute name.
241241
* @param mixed $value The value of the attribute.
242-
* @return self
242+
* @return static
243243
*/
244244
public function withAttribute($name, $value);
245245

@@ -255,7 +255,7 @@ public function withAttribute($name, $value);
255255
*
256256
* @see getAttributes()
257257
* @param string $name The attribute name.
258-
* @return self
258+
* @return static
259259
*/
260260
public function withoutAttribute($name);
261261
}

src/UriInterface.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public function getFragment();
185185
* An empty scheme is equivalent to removing the scheme.
186186
*
187187
* @param string $scheme The scheme to use with the new instance.
188-
* @return self A new instance with the specified scheme.
188+
* @return static A new instance with the specified scheme.
189189
* @throws \InvalidArgumentException for invalid or unsupported schemes.
190190
*/
191191
public function withScheme($scheme);
@@ -202,7 +202,7 @@ public function withScheme($scheme);
202202
*
203203
* @param string $user The user name to use for authority.
204204
* @param null|string $password The password associated with $user.
205-
* @return self A new instance with the specified user information.
205+
* @return static A new instance with the specified user information.
206206
*/
207207
public function withUserInfo($user, $password = null);
208208

@@ -215,7 +215,7 @@ public function withUserInfo($user, $password = null);
215215
* An empty host value is equivalent to removing the host.
216216
*
217217
* @param string $host The hostname to use with the new instance.
218-
* @return self A new instance with the specified host.
218+
* @return static A new instance with the specified host.
219219
* @throws \InvalidArgumentException for invalid hostnames.
220220
*/
221221
public function withHost($host);
@@ -234,7 +234,7 @@ public function withHost($host);
234234
*
235235
* @param null|int $port The port to use with the new instance; a null value
236236
* removes the port information.
237-
* @return self A new instance with the specified port.
237+
* @return static A new instance with the specified port.
238238
* @throws \InvalidArgumentException for invalid ports.
239239
*/
240240
public function withPort($port);
@@ -258,7 +258,7 @@ public function withPort($port);
258258
* Implementations ensure the correct encoding as outlined in getPath().
259259
*
260260
* @param string $path The path to use with the new instance.
261-
* @return self A new instance with the specified path.
261+
* @return static A new instance with the specified path.
262262
* @throws \InvalidArgumentException for invalid paths.
263263
*/
264264
public function withPath($path);
@@ -275,7 +275,7 @@ public function withPath($path);
275275
* An empty query string value is equivalent to removing the query string.
276276
*
277277
* @param string $query The query string to use with the new instance.
278-
* @return self A new instance with the specified query string.
278+
* @return static A new instance with the specified query string.
279279
* @throws \InvalidArgumentException for invalid query strings.
280280
*/
281281
public function withQuery($query);
@@ -292,7 +292,7 @@ public function withQuery($query);
292292
* An empty fragment value is equivalent to removing the fragment.
293293
*
294294
* @param string $fragment The fragment to use with the new instance.
295-
* @return self A new instance with the specified fragment.
295+
* @return static A new instance with the specified fragment.
296296
*/
297297
public function withFragment($fragment);
298298

0 commit comments

Comments
 (0)