@@ -209,8 +209,7 @@ discard block |
||
| 209 | 209 | if (! \is_string($protocolVersion)) |
| 210 | 210 | { |
| 211 | 211 | throw new \InvalidArgumentException('HTTP protocol version must be a string'); |
| 212 | - } |
|
| 213 | - else if (! \preg_match('/^\d(?:\.\d)?$/', $protocolVersion)) |
|
| 212 | + } else if (! \preg_match('/^\d(?:\.\d)?$/', $protocolVersion)) |
|
| 214 | 213 | { |
| 215 | 214 | throw new \InvalidArgumentException(\sprintf('The given protocol version "%s" is not valid', $protocolVersion)); |
| 216 | 215 | } |
@@ -232,8 +231,7 @@ discard block |
||
| 232 | 231 | if (! \is_string($headerName)) |
| 233 | 232 | { |
| 234 | 233 | throw new \InvalidArgumentException('Header name must be a string'); |
| 235 | - } |
|
| 236 | - else if (! \preg_match(RFC7230_TOKEN, $headerName)) |
|
| 234 | + } else if (! \preg_match(RFC7230_TOKEN, $headerName)) |
|
| 237 | 235 | { |
| 238 | 236 | throw new \InvalidArgumentException(\sprintf('The given header name "%s" is not valid', $headerName)); |
| 239 | 237 | } |
@@ -267,8 +265,7 @@ discard block |
||
| 267 | 265 | if (! \is_string($oneOf)) |
| 268 | 266 | { |
| 269 | 267 | throw new \InvalidArgumentException('Header value must be a string or an array containing only strings'); |
| 270 | - } |
|
| 271 | - else if (! \preg_match(RFC7230_FIELD_VALUE, $oneOf)) |
|
| 268 | + } else if (! \preg_match(RFC7230_FIELD_VALUE, $oneOf)) |
|
| 272 | 269 | { |
| 273 | 270 | throw new \InvalidArgumentException(\sprintf('The given header value "%s" is not valid', $oneOf)); |
| 274 | 271 | } |
@@ -167,8 +167,7 @@ discard block |
||
| 167 | 167 | if (! \is_string($method)) |
| 168 | 168 | { |
| 169 | 169 | throw new \InvalidArgumentException('HTTP method must be a string'); |
| 170 | - } |
|
| 171 | - else if (! \preg_match(RFC7230_TOKEN, $method)) |
|
| 170 | + } else if (! \preg_match(RFC7230_TOKEN, $method)) |
|
| 172 | 171 | { |
| 173 | 172 | throw new \InvalidArgumentException(\sprintf('The given method "%s" is not valid', $method)); |
| 174 | 173 | } |
@@ -190,8 +189,7 @@ discard block |
||
| 190 | 189 | if (! \is_string($requestTarget)) |
| 191 | 190 | { |
| 192 | 191 | throw new \InvalidArgumentException('HTTP request-target must be a string'); |
| 193 | - } |
|
| 194 | - else if (! \preg_match('/^[\x21-\x7E\x80-\xFF]+$/', $requestTarget)) |
|
| 192 | + } else if (! \preg_match('/^[\x21-\x7E\x80-\xFF]+$/', $requestTarget)) |
|
| 195 | 193 | { |
| 196 | 194 | throw new \InvalidArgumentException(\sprintf('The given request-target "%s" is not valid', $requestTarget)); |
| 197 | 195 | } |
@@ -90,8 +90,7 @@ discard block |
||
| 90 | 90 | if (! \is_int($statusCode)) |
| 91 | 91 | { |
| 92 | 92 | throw new \InvalidArgumentException('HTTP status-code must be an integer'); |
| 93 | - } |
|
| 94 | - else if (! ($statusCode >= 100 && $statusCode <= 599)) |
|
| 93 | + } else if (! ($statusCode >= 100 && $statusCode <= 599)) |
|
| 95 | 94 | { |
| 96 | 95 | throw new \InvalidArgumentException(\sprintf('The given status-code "%d" is not valid', $statusCode)); |
| 97 | 96 | } |
@@ -111,8 +110,7 @@ discard block |
||
| 111 | 110 | if (! \is_string($reasonPhrase)) |
| 112 | 111 | { |
| 113 | 112 | throw new \InvalidArgumentException('HTTP reason-phrase must be a string'); |
| 114 | - } |
|
| 115 | - else if (! \preg_match(RFC7230_FIELD_VALUE, $reasonPhrase)) |
|
| 113 | + } else if (! \preg_match(RFC7230_FIELD_VALUE, $reasonPhrase)) |
|
| 116 | 114 | { |
| 117 | 115 | throw new \InvalidArgumentException(\sprintf('The given reason-phrase "%s" is not valid', $reasonPhrase)); |
| 118 | 116 | } |