Passed
Push — master ( 66a961...b942dd )
by Anatoly
03:30
created
src/Message.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -223,8 +223,7 @@  discard block
 block discarded – undo
223 223
 		if (! \is_string($protocolVersion))
224 224
 		{
225 225
 			throw new \InvalidArgumentException('HTTP protocol version must be a string');
226
-		}
227
-		else if (! \preg_match('/^\d(?:\.\d)?$/', $protocolVersion))
226
+		} else if (! \preg_match('/^\d(?:\.\d)?$/', $protocolVersion))
228 227
 		{
229 228
 			throw new \InvalidArgumentException(\sprintf('The given protocol version "%s" is not valid', $protocolVersion));
230 229
 		}
@@ -246,8 +245,7 @@  discard block
 block discarded – undo
246 245
 		if (! \is_string($headerName))
247 246
 		{
248 247
 			throw new \InvalidArgumentException('Header name must be a string');
249
-		}
250
-		else if (! \preg_match(self::RFC7230_TOKEN, $headerName))
248
+		} else if (! \preg_match(self::RFC7230_TOKEN, $headerName))
251 249
 		{
252 250
 			throw new \InvalidArgumentException(\sprintf('The given header name "%s" is not valid', $headerName));
253 251
 		}
@@ -281,8 +279,7 @@  discard block
 block discarded – undo
281 279
 			if (! \is_string($oneOf))
282 280
 			{
283 281
 				throw new \InvalidArgumentException('Header value must be a string or an array containing only strings');
284
-			}
285
-			else if (! \preg_match(self::RFC7230_FIELD_VALUE, $oneOf))
282
+			} else if (! \preg_match(self::RFC7230_FIELD_VALUE, $oneOf))
286 283
 			{
287 284
 				throw new \InvalidArgumentException(\sprintf('The given header value "%s" is not valid', $oneOf));
288 285
 			}
Please login to merge, or discard this patch.
src/Request.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -167,8 +167,7 @@  discard block
 block discarded – undo
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(self::RFC7230_TOKEN, $method))
170
+		} else if (! \preg_match(self::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
 block discarded – undo
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
 		}
Please login to merge, or discard this patch.
src/Response.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -90,8 +90,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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(self::RFC7230_FIELD_VALUE, $reasonPhrase))
113
+		} else if (! \preg_match(self::RFC7230_FIELD_VALUE, $reasonPhrase))
116 114
 		{
117 115
 			throw new \InvalidArgumentException(\sprintf('The given reason-phrase "%s" is not valid', $reasonPhrase));
118 116
 		}
Please login to merge, or discard this patch.