Skip to content

Commit 2107b79

Browse files
committed
coding style
1 parent 38da0eb commit 2107b79

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/Http/RequestFactory.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ public function createHttpRequest()
6969
$url->setPassword(isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : '');
7070

7171
// host & port
72-
if ((isset($_SERVER[$tmp = 'HTTP_HOST']) || isset($_SERVER[$tmp = 'SERVER_NAME']))
72+
if (
73+
(isset($_SERVER[$tmp = 'HTTP_HOST']) || isset($_SERVER[$tmp = 'SERVER_NAME']))
7374
&& preg_match('#^([a-z0-9_.-]+|\[[a-f0-9:]+\])(:\d+)?\z#i', $_SERVER[$tmp], $pair)
7475
) {
7576
$url->setHost(strtolower($pair[1]));
@@ -135,7 +136,9 @@ public function createHttpRequest()
135136
$list = [];
136137
if (!empty($_FILES)) {
137138
foreach ($_FILES as $k => $v) {
138-
if (!is_array($v) || !isset($v['name'], $v['type'], $v['size'], $v['tmp_name'], $v['error'])
139+
if (
140+
!is_array($v)
141+
|| !isset($v['name'], $v['type'], $v['size'], $v['tmp_name'], $v['error'])
139142
|| (!$this->binary && is_string($k) && (!preg_match($reChars, $k) || preg_last_error()))
140143
) {
141144
continue;
@@ -266,7 +269,9 @@ public function createHttpRequest()
266269

267270
// method, eg. GET, PUT, ...
268271
$method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : null;
269-
if ($method === 'POST' && isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'])
272+
if (
273+
$method === 'POST'
274+
&& isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'])
270275
&& preg_match('#^[A-Z]+\z#', $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'])
271276
) {
272277
$method = $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'];

src/Http/Response.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,10 @@ public static function date($time = null)
240240

241241
public function __destruct()
242242
{
243-
if (self::$fixIE && isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE ') !== false
243+
if (
244+
self::$fixIE
245+
&& isset($_SERVER['HTTP_USER_AGENT'])
246+
&& strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE ') !== false
244247
&& in_array($this->code, [400, 403, 404, 405, 406, 408, 409, 410, 500, 501, 505], true)
245248
&& preg_match('#^text/html(?:;|$)#', $this->getHeader('Content-Type'))
246249
) {

0 commit comments

Comments
 (0)