@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | public function withHeader($name, $value): self |
| 64 | 64 | { |
| 65 | 65 | $name = strtolower($name); |
| 66 | - $this->headers[$name] = $this->validateAndTrimHeader($name, (array)$value); |
|
| 66 | + $this->headers[$name] = $this->validateAndTrimHeader($name, (array) $value); |
|
| 67 | 67 | return $this; |
| 68 | 68 | } |
| 69 | 69 | |
@@ -108,11 +108,11 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | $returnValues = []; |
| 110 | 110 | foreach ($values as $v) { |
| 111 | - if ((!is_numeric($v) && !is_string($v)) || 1 !== preg_match("@^[ \t\x21-\x7E\x80-\xFF]*$@", (string)$v)) { |
|
| 111 | + if ((!is_numeric($v) && !is_string($v)) || 1 !== preg_match("@^[ \t\x21-\x7E\x80-\xFF]*$@", (string) $v)) { |
|
| 112 | 112 | throw new InvalidArgumentException('Header values must be RFC 7230 compatible strings.'); |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | - $returnValues[] = trim((string)$v); |
|
| 115 | + $returnValues[] = trim((string) $v); |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | return $returnValues; |
@@ -127,15 +127,15 @@ discard block |
||
| 127 | 127 | protected function setHeaders(array $headers): void |
| 128 | 128 | { |
| 129 | 129 | foreach ($headers as $name => $values) { |
| 130 | - $values = (array)$values; |
|
| 131 | - $name = strtolower((string)$name); |
|
| 130 | + $values = (array) $values; |
|
| 131 | + $name = strtolower((string) $name); |
|
| 132 | 132 | |
| 133 | 133 | if (!$this->hasHeader($name)) { |
| 134 | 134 | $this->headers[$name] = []; |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | foreach ($values as $value) { |
| 138 | - $value = $this->validateAndTrimHeader($name, (array)$value)[0]; |
|
| 138 | + $value = $this->validateAndTrimHeader($name, (array) $value)[0]; |
|
| 139 | 139 | $this->headers[$name][] = $value; |
| 140 | 140 | } |
| 141 | 141 | } |