From 72f3089372884311405161deeb1eff50f56e677c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Mo=CC=88ller?= Date: Sun, 31 May 2015 14:56:10 +0100 Subject: [PATCH] Fix: Return static instead of self --- src/MessageTrait.php | 10 +++++----- src/RequestTrait.php | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/MessageTrait.php b/src/MessageTrait.php index f6dcee5b..363b48ee 100644 --- a/src/MessageTrait.php +++ b/src/MessageTrait.php @@ -66,7 +66,7 @@ public function getProtocolVersion() * new protocol version. * * @param string $version HTTP protocol version - * @return self + * @return static */ public function withProtocolVersion($version) { @@ -184,7 +184,7 @@ public function getHeaderLine($header) * * @param string $header 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($header, $value) @@ -225,7 +225,7 @@ public function withHeader($header, $value) * * @param string $header 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($header, $value) @@ -265,7 +265,7 @@ public function withAddedHeader($header, $value) * the named header. * * @param string $header Case-insensitive header field name to remove. - * @return self + * @return static */ public function withoutHeader($header) { @@ -301,7 +301,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) diff --git a/src/RequestTrait.php b/src/RequestTrait.php index 7f9311d5..2e44480b 100644 --- a/src/RequestTrait.php +++ b/src/RequestTrait.php @@ -155,7 +155,7 @@ public function getRequestTarget() * @link http://tools.ietf.org/html/rfc7230#section-2.7 (for the various * request-target forms allowed in request messages) * @param mixed $requestTarget - * @return self + * @return static * @throws InvalidArgumentException if the request target is invalid. */ public function withRequestTarget($requestTarget) @@ -193,7 +193,7 @@ public function getMethod() * changed request method. * * @param string $method Case-insensitive method. - * @return self + * @return static * @throws InvalidArgumentException for invalid HTTP methods. */ public function withMethod($method) @@ -241,7 +241,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) {