Skip to content

Commit 80c8d95

Browse files
committed
Merge pull request #5 from sagikazarmark/hotfix/sync-with-proposal
Syncs interfaces with proposal
2 parents 69271a5 + dae7a8e commit 80c8d95

File tree

3 files changed

+25
-14
lines changed

3 files changed

+25
-14
lines changed

src/IncomingRequestInterface.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ interface IncomingRequestInterface extends RequestInterface
2323
*
2424
* The return value can be either an array or an object that acts like
2525
* an array (e.g., implements ArrayAccess, or an ArrayObject).
26-
*
26+
*
2727
* @return array|\ArrayAccess
2828
*/
2929
public function getCookieParams();
@@ -39,9 +39,9 @@ public function getCookieParams();
3939
*
4040
* The value provided should be an array or array-like object
4141
* (e.g., implements ArrayAccess, or an ArrayObject).
42-
*
42+
*
4343
* @param array|\ArrayAccess $cookies Cookie values/structs
44-
*
44+
*
4545
* @return void
4646
*/
4747
public function setCookieParams($cookies);
@@ -57,7 +57,7 @@ public function setCookieParams($cookies);
5757
*
5858
* The return value can be either an array or an object that acts like
5959
* an array (e.g., implements ArrayAccess, or an ArrayObject).
60-
*
60+
*
6161
* @return array
6262
*/
6363
public function getQueryParams();
@@ -74,7 +74,7 @@ public function getQueryParams();
7474
*
7575
* The return value can be either an array or an object that acts like
7676
* an array (e.g., implements ArrayAccess, or an ArrayObject).
77-
*
77+
*
7878
* @return array Upload file(s) metadata, if any.
7979
*/
8080
public function getFileParams();
@@ -88,7 +88,7 @@ public function getFileParams();
8888
*
8989
* In other cases, the parent getBody() method should be used to retrieve
9090
* the body content.
91-
*
91+
*
9292
* @return array|object The deserialized body parameters, if any. These may
9393
* be either an array or an object, though an array or
9494
* array-like object is recommended.
@@ -101,7 +101,7 @@ public function getBodyParams();
101101
* If the body content can be deserialized, the values obtained may then
102102
* be injected into the response using this method. This method will
103103
* typically be invoked by a factory marshaling request parameters.
104-
*
104+
*
105105
* @param array|object $values The deserialized body parameters, if any.
106106
* These may be either an array or an object,
107107
* though an array or array-like object is
@@ -128,7 +128,7 @@ public function getPathParams();
128128
* If a router or similar is used to match against the path and/or request,
129129
* this method can be used to inject the request with the results, so long
130130
* as those results can be represented as an array or array-like object.
131-
*
131+
*
132132
* @param array|\ArrayAccess $values Path parameters matched by routing
133133
*
134134
* @return void

src/MessageInterface.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ public function getHeaderAsArray($header);
106106
* or an array of strings.
107107
*
108108
* @param string $header Header name
109-
* @param string|string[] $value Header value(s)
109+
* @param string|string[]|object|object[] $value Header value(s). Values may
110+
* be objects as long as they
111+
* can be cast to strings.
110112
*
111113
* @return void
112114
*/
@@ -115,8 +117,9 @@ public function setHeader($header, $value);
115117
/**
116118
* Sets headers, replacing any headers that have already been set on the message.
117119
*
118-
* The array keys MUST be a string. The array values must be either a
119-
* string or an array of strings.
120+
* The array keys MUST be a string. Each array value MUST be either a string
121+
* or object, or array of strings and/or objects; any object used as a
122+
* header value MUST be able to be cast to a string.
120123
*
121124
* @param array $headers Headers to set.
122125
*
@@ -131,7 +134,8 @@ public function setHeaders(array $headers);
131134
* value will be appended to the existing list.
132135
*
133136
* @param string $header Header name to add
134-
* @param string $value Value of the header
137+
* @param string|object $value Value of the header; object is allowed if it
138+
* can be cast to a string.
135139
*
136140
* @return void
137141
*/
@@ -141,7 +145,10 @@ public function addHeader($header, $value);
141145
* Merges in an associative array of headers.
142146
*
143147
* Each array key MUST be a string representing the case-insensitive name
144-
* of a header. Each value MUST be either a string or an array of strings.
148+
* of a header. Each value MUST be either a string or object, or array of
149+
* strings and/or objects; any object used as a header value MUST be able
150+
* to be cast to a string.
151+
*
145152
* For each value, the value is appended to any existing header of the same
146153
* name, or, if a header does not already exist by the given name, then the
147154
* header is added.

src/StreamableInterface.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
namespace Psr\Http\Message;
44

55
/**
6-
* Describes a stream instance.
6+
* Describes streamable content.
7+
*
8+
* Typically, an instance will wrap a PHP stream; this interface provides
9+
* a wrapper around the most common operations, including serialization of
10+
* the entire stream to a string.
711
*/
812
interface StreamableInterface
913
{

0 commit comments

Comments
 (0)