Skip to content

Commit

Permalink
Merge pull request #50 from localheinz/fix/return
Browse files Browse the repository at this point in the history
Fix: Return static instead of self

* localheinz/fix/return:
  Fix: Return static instead of self
  • Loading branch information
michaelcullum committed Aug 5, 2016
2 parents d0aabc0 + a6764a4 commit 14b9b81
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
10 changes: 5 additions & 5 deletions src/MessageInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function getProtocolVersion();
* new protocol version.
*
* @param string $version HTTP protocol version
* @return self
* @return static
*/
public function withProtocolVersion($version);

Expand Down Expand Up @@ -126,7 +126,7 @@ public function getHeaderLine($name);
*
* @param string $name Case-insensitive header field name.
* @param string|string[] $value Header value(s).
* @return self
* @return static
* @throws \InvalidArgumentException for invalid header names or values.
*/
public function withHeader($name, $value);
Expand All @@ -144,7 +144,7 @@ public function withHeader($name, $value);
*
* @param string $name Case-insensitive header field name to add.
* @param string|string[] $value Header value(s).
* @return self
* @return static
* @throws \InvalidArgumentException for invalid header names or values.
*/
public function withAddedHeader($name, $value);
Expand All @@ -159,7 +159,7 @@ public function withAddedHeader($name, $value);
* the named header.
*
* @param string $name Case-insensitive header field name to remove.
* @return self
* @return static
*/
public function withoutHeader($name);

Expand All @@ -180,7 +180,7 @@ public function getBody();
* new body stream.
*
* @param StreamInterface $body Body.
* @return self
* @return static
* @throws \InvalidArgumentException When the body is not valid.
*/
public function withBody(StreamInterface $body);
Expand Down
6 changes: 3 additions & 3 deletions src/RequestInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function getRequestTarget();
* @link http://tools.ietf.org/html/rfc7230#section-5.3 (for the various
* request-target forms allowed in request messages)
* @param mixed $requestTarget
* @return self
* @return static
*/
public function withRequestTarget($requestTarget);

Expand All @@ -79,7 +79,7 @@ public function getMethod();
* changed request method.
*
* @param string $method Case-sensitive method.
* @return self
* @return static
* @throws \InvalidArgumentException for invalid HTTP methods.
*/
public function withMethod($method);
Expand Down Expand Up @@ -123,7 +123,7 @@ public function getUri();
* @link http://tools.ietf.org/html/rfc3986#section-4.3
* @param UriInterface $uri New request URI to use.
* @param bool $preserveHost Preserve the original state of the Host header.
* @return self
* @return static
*/
public function withUri(UriInterface $uri, $preserveHost = false);
}
2 changes: 1 addition & 1 deletion src/ResponseInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function getStatusCode();
* @param string $reasonPhrase The reason phrase to use with the
* provided status code; if none is provided, implementations MAY
* use the defaults as suggested in the HTTP specification.
* @return self
* @return static
* @throws \InvalidArgumentException For invalid status code arguments.
*/
public function withStatus($code, $reasonPhrase = '');
Expand Down
12 changes: 6 additions & 6 deletions src/ServerRequestInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function getCookieParams();
* updated cookie values.
*
* @param array $cookies Array of key/value pairs representing cookies.
* @return self
* @return static
*/
public function withCookieParams(array $cookies);

Expand Down Expand Up @@ -118,7 +118,7 @@ public function getQueryParams();
*
* @param array $query Array of query string arguments, typically from
* $_GET.
* @return self
* @return static
*/
public function withQueryParams(array $query);

Expand All @@ -144,7 +144,7 @@ public function getUploadedFiles();
* updated body parameters.
*
* @param array $uploadedFiles An array tree of UploadedFileInterface instances.
* @return self
* @return static
* @throws \InvalidArgumentException if an invalid structure is provided.
*/
public function withUploadedFiles(array $uploadedFiles);
Expand Down Expand Up @@ -190,7 +190,7 @@ public function getParsedBody();
*
* @param null|array|object $data The deserialized body data. This will
* typically be in an array or object.
* @return self
* @return static
* @throws \InvalidArgumentException if an unsupported argument type is
* provided.
*/
Expand Down Expand Up @@ -239,7 +239,7 @@ public function getAttribute($name, $default = null);
* @see getAttributes()
* @param string $name The attribute name.
* @param mixed $value The value of the attribute.
* @return self
* @return static
*/
public function withAttribute($name, $value);

Expand All @@ -255,7 +255,7 @@ public function withAttribute($name, $value);
*
* @see getAttributes()
* @param string $name The attribute name.
* @return self
* @return static
*/
public function withoutAttribute($name);
}
14 changes: 7 additions & 7 deletions src/UriInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public function getFragment();
* An empty scheme is equivalent to removing the scheme.
*
* @param string $scheme The scheme to use with the new instance.
* @return self A new instance with the specified scheme.
* @return static A new instance with the specified scheme.
* @throws \InvalidArgumentException for invalid or unsupported schemes.
*/
public function withScheme($scheme);
Expand All @@ -202,7 +202,7 @@ public function withScheme($scheme);
*
* @param string $user The user name to use for authority.
* @param null|string $password The password associated with $user.
* @return self A new instance with the specified user information.
* @return static A new instance with the specified user information.
*/
public function withUserInfo($user, $password = null);

Expand All @@ -215,7 +215,7 @@ public function withUserInfo($user, $password = null);
* An empty host value is equivalent to removing the host.
*
* @param string $host The hostname to use with the new instance.
* @return self A new instance with the specified host.
* @return static A new instance with the specified host.
* @throws \InvalidArgumentException for invalid hostnames.
*/
public function withHost($host);
Expand All @@ -234,7 +234,7 @@ public function withHost($host);
*
* @param null|int $port The port to use with the new instance; a null value
* removes the port information.
* @return self A new instance with the specified port.
* @return static A new instance with the specified port.
* @throws \InvalidArgumentException for invalid ports.
*/
public function withPort($port);
Expand All @@ -258,7 +258,7 @@ public function withPort($port);
* Implementations ensure the correct encoding as outlined in getPath().
*
* @param string $path The path to use with the new instance.
* @return self A new instance with the specified path.
* @return static A new instance with the specified path.
* @throws \InvalidArgumentException for invalid paths.
*/
public function withPath($path);
Expand All @@ -275,7 +275,7 @@ public function withPath($path);
* An empty query string value is equivalent to removing the query string.
*
* @param string $query The query string to use with the new instance.
* @return self A new instance with the specified query string.
* @return static A new instance with the specified query string.
* @throws \InvalidArgumentException for invalid query strings.
*/
public function withQuery($query);
Expand All @@ -292,7 +292,7 @@ public function withQuery($query);
* An empty fragment value is equivalent to removing the fragment.
*
* @param string $fragment The fragment to use with the new instance.
* @return self A new instance with the specified fragment.
* @return static A new instance with the specified fragment.
*/
public function withFragment($fragment);

Expand Down

0 comments on commit 14b9b81

Please sign in to comment.