@@ -93,8 +93,7 @@ discard block |
||
| 93 | 93 | if (! \is_int($statusCode)) |
| 94 | 94 | { |
| 95 | 95 | throw new \InvalidArgumentException('HTTP status-code must be an integer'); |
| 96 | - } |
|
| 97 | - else if (! ($statusCode >= 100 && $statusCode <= 599)) |
|
| 96 | + } else if (! ($statusCode >= 100 && $statusCode <= 599)) |
|
| 98 | 97 | { |
| 99 | 98 | throw new \InvalidArgumentException(\sprintf('The given status-code "%d" is not valid', $statusCode)); |
| 100 | 99 | } |
@@ -116,8 +115,7 @@ discard block |
||
| 116 | 115 | if (! \is_string($reasonPhrase)) |
| 117 | 116 | { |
| 118 | 117 | throw new \InvalidArgumentException('HTTP reason-phrase must be a string'); |
| 119 | - } |
|
| 120 | - else if (! \preg_match(HeaderInterface::RFC7230_FIELD_VALUE, $reasonPhrase)) |
|
| 118 | + } else if (! \preg_match(HeaderInterface::RFC7230_FIELD_VALUE, $reasonPhrase)) |
|
| 121 | 119 | { |
| 122 | 120 | throw new \InvalidArgumentException(\sprintf('The given reason-phrase "%s" is not valid', $reasonPhrase)); |
| 123 | 121 | } |
@@ -168,8 +168,7 @@ discard block |
||
| 168 | 168 | if (! \is_string($method)) |
| 169 | 169 | { |
| 170 | 170 | throw new \InvalidArgumentException('HTTP method must be a string'); |
| 171 | - } |
|
| 172 | - else if (! \preg_match(HeaderInterface::RFC7230_TOKEN, $method)) |
|
| 171 | + } else if (! \preg_match(HeaderInterface::RFC7230_TOKEN, $method)) |
|
| 173 | 172 | { |
| 174 | 173 | throw new \InvalidArgumentException(\sprintf('The given method "%s" is not valid', $method)); |
| 175 | 174 | } |
@@ -191,8 +190,7 @@ discard block |
||
| 191 | 190 | if (! \is_string($requestTarget)) |
| 192 | 191 | { |
| 193 | 192 | throw new \InvalidArgumentException('HTTP request-target must be a string'); |
| 194 | - } |
|
| 195 | - else if (! \preg_match('/^[\x21-\x7E\x80-\xFF]+$/', $requestTarget)) |
|
| 193 | + } else if (! \preg_match('/^[\x21-\x7E\x80-\xFF]+$/', $requestTarget)) |
|
| 196 | 194 | { |
| 197 | 195 | throw new \InvalidArgumentException(\sprintf('The given request-target "%s" is not valid', $requestTarget)); |
| 198 | 196 | } |