Update PhpDoc return types as static to match updated PSR-7 interfaces
This commit is contained in:
parent
36a170bcff
commit
83381bf5d5
|
|
@ -77,7 +77,7 @@ abstract class Message implements MessageInterface
|
|||
* "1.1", "1.0").
|
||||
*
|
||||
* @param string $version HTTP protocol version
|
||||
* @return self
|
||||
* @return static
|
||||
*/
|
||||
public function withProtocolVersion($version)
|
||||
{
|
||||
|
|
@ -192,7 +192,7 @@ abstract class Message implements MessageInterface
|
|||
*
|
||||
* @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)
|
||||
|
|
@ -216,7 +216,7 @@ abstract class Message implements MessageInterface
|
|||
*
|
||||
* @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)
|
||||
|
|
@ -234,7 +234,7 @@ abstract class Message implements MessageInterface
|
|||
* Creates a new instance, without the specified header.
|
||||
*
|
||||
* @param string $name Case-insensitive header field name to remove.
|
||||
* @return self
|
||||
* @return static
|
||||
*/
|
||||
public function withoutHeader($name)
|
||||
{
|
||||
|
|
@ -259,7 +259,7 @@ abstract class Message implements MessageInterface
|
|||
* The body MUST be a StreamInterface object.
|
||||
*
|
||||
* @param StreamInterface $body Body.
|
||||
* @return self
|
||||
* @return static
|
||||
* @throws \InvalidArgumentException When the body is not valid.
|
||||
*/
|
||||
public function withBody(StreamInterface $body)
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ class NullStream implements StreamInterface
|
|||
*/
|
||||
public function detach()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class Request extends Message implements RequestInterface
|
|||
/**
|
||||
* Create a new Request.
|
||||
*
|
||||
* @see WellRESTed\Message\Message
|
||||
* @see \WellRESTed\Message\Message
|
||||
* @param UriInterface $uri
|
||||
* @param string $method
|
||||
* @param array $headers
|
||||
|
|
@ -109,7 +109,7 @@ class Request extends Message implements RequestInterface
|
|||
* @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
|
||||
*/
|
||||
public function withRequestTarget($requestTarget)
|
||||
{
|
||||
|
|
@ -136,7 +136,7 @@ class Request extends Message implements RequestInterface
|
|||
* modify the given string.
|
||||
*
|
||||
* @param string $method Case-insensitive method.
|
||||
* @return self
|
||||
* @return static
|
||||
* @throws \InvalidArgumentException for invalid HTTP methods.
|
||||
*/
|
||||
public function withMethod($method)
|
||||
|
|
@ -182,7 +182,7 @@ class Request extends Message implements RequestInterface
|
|||
* @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)
|
||||
{
|
||||
|
|
@ -212,7 +212,7 @@ class Request extends Message implements RequestInterface
|
|||
|
||||
/**
|
||||
* @param string $method
|
||||
* @return string
|
||||
* @return static
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
private function getValidatedMethod($method)
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class Response extends Message implements ResponseInterface
|
|||
* If no StreamInterface is provided for $body, the instance will create
|
||||
* a NullStream instance for the message body.
|
||||
*
|
||||
* @see WellRESTed\Message\Message
|
||||
* @see \WellRESTed\Message\Message
|
||||
* @param int $statusCode
|
||||
* @param array $headers
|
||||
* @param StreamInterface $body
|
||||
|
|
@ -69,11 +69,11 @@ class Response extends Message implements ResponseInterface
|
|||
* reason phrase, if possible.
|
||||
*
|
||||
* @link http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
|
||||
* @param integer $code The 3-digit integer result code to set.
|
||||
* @param int $code The 3-digit integer result code to set.
|
||||
* @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 = "")
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ class ServerRequest extends Request implements ServerRequestInterface
|
|||
* be injected at instantiation.
|
||||
*
|
||||
* @param array $cookies Array of key/value pairs representing cookies.
|
||||
* @return self
|
||||
* @return static
|
||||
*/
|
||||
public function withCookieParams(array $cookies)
|
||||
{
|
||||
|
|
@ -157,7 +157,7 @@ class ServerRequest extends Request implements ServerRequestInterface
|
|||
*
|
||||
* @param array $query Array of query string arguments, typically from
|
||||
* $_GET.
|
||||
* @return self
|
||||
* @return static
|
||||
*/
|
||||
public function withQueryParams(array $query)
|
||||
{
|
||||
|
|
@ -187,7 +187,7 @@ class ServerRequest extends Request implements ServerRequestInterface
|
|||
* Create a new instance with the specified uploaded files.
|
||||
*
|
||||
* @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)
|
||||
|
|
@ -242,7 +242,7 @@ class ServerRequest extends Request implements ServerRequestInterface
|
|||
*
|
||||
* @param null|array|object $data The deserialized body data. This will
|
||||
* typically be in an array or object.
|
||||
* @return self
|
||||
* @return static
|
||||
*/
|
||||
public function withParsedBody($data)
|
||||
{
|
||||
|
|
@ -303,7 +303,7 @@ class ServerRequest extends Request implements ServerRequestInterface
|
|||
* @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)
|
||||
{
|
||||
|
|
@ -325,7 +325,7 @@ class ServerRequest extends Request implements ServerRequestInterface
|
|||
*
|
||||
* @see getAttributes()
|
||||
* @param string $name The attribute name.
|
||||
* @return self
|
||||
* @return static
|
||||
*/
|
||||
public function withoutAttribute($name)
|
||||
{
|
||||
|
|
@ -446,7 +446,7 @@ class ServerRequest extends Request implements ServerRequestInterface
|
|||
* from the server's information about the request sent to the server.
|
||||
*
|
||||
* @param array $attributes Key-value pairs to add to the request.
|
||||
* @return self
|
||||
* @return static
|
||||
* @static
|
||||
*/
|
||||
public static function getServerRequest(array $attributes = null)
|
||||
|
|
|
|||
|
|
@ -300,7 +300,7 @@ class Uri implements UriInterface
|
|||
* 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)
|
||||
|
|
@ -326,7 +326,7 @@ class Uri implements UriInterface
|
|||
*
|
||||
* @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)
|
||||
{
|
||||
|
|
@ -345,7 +345,7 @@ class Uri implements UriInterface
|
|||
* 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)
|
||||
|
|
@ -373,7 +373,7 @@ class Uri implements UriInterface
|
|||
*
|
||||
* @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)
|
||||
|
|
@ -407,7 +407,7 @@ class Uri implements UriInterface
|
|||
* 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)
|
||||
|
|
@ -432,7 +432,7 @@ class Uri implements UriInterface
|
|||
* 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)
|
||||
|
|
@ -454,7 +454,7 @@ class Uri implements UriInterface
|
|||
* 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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue