File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ class HeaderUtil{
23
23
* An exception is being made for Set-Cookie, which holds an array of values for each cookie.
24
24
* For multiple cookies with the same name, only the last value will be kept.
25
25
*/
26
- public static function normalize (array $ headers ):array {
26
+ public static function normalize (iterable $ headers ):array {
27
27
$ normalized = [];
28
28
29
29
foreach ($ headers as $ key => $ val ){
@@ -98,8 +98,13 @@ public static function normalize(array $headers):array{
98
98
*
99
99
* @see https://tools.ietf.org/html/rfc7230#section-3.2.4
100
100
*/
101
- public static function trimValues (array $ values ):array {
102
- return array_map (fn (string $ value ):string => trim ($ value , " \t" ), $ values );
101
+ public static function trimValues (iterable $ values ):iterable {
102
+
103
+ foreach ($ values as &$ value ){
104
+ $ value = trim ($ value , " \t" );
105
+ }
106
+
107
+ return $ values ;
103
108
}
104
109
105
110
/**
Original file line number Diff line number Diff line change @@ -118,12 +118,12 @@ public function createUriFromGlobals():UriInterface{
118
118
/**
119
119
* Returns an UploadedFile instance array.
120
120
*
121
- * @param array $files An array which respect $_FILES structure
121
+ * @param iterable $files An array which respects $_FILES structure
122
122
*
123
123
* @return \Psr\Http\Message\UploadedFileInterface[]
124
124
* @throws \InvalidArgumentException for unrecognized values
125
125
*/
126
- public function normalizeFiles (array $ files ):array {
126
+ public function normalizeFiles (iterable $ files ):array {
127
127
$ normalized = [];
128
128
129
129
foreach ($ files as $ key => $ value ){
You can’t perform that action at this time.
0 commit comments