@@ -50,7 +50,7 @@ |
||
| 50 | 50 | */ |
| 51 | 51 | public static function create($config = []) |
| 52 | 52 | { |
| 53 | - if (!static::$_instance instanceof static ) { |
|
| 53 | + if (!static::$_instance instanceof static) { |
|
| 54 | 54 | static::$_instance = new static(); |
| 55 | 55 | static::$_instance->__formName = I::get($config, 'formName', 'file'); |
| 56 | 56 | static::$_instance->__sizeLimit = static::$_instance->__getSizeLimit(I::get($config, 'sizeLimit', 0)); |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | */ |
| 102 | 102 | public function getHeader($name) |
| 103 | 103 | { |
| 104 | - return (string) Arrays::first((array) I::get($this->getHeaders(), $name, [])); |
|
| 104 | + return (string)Arrays::first((array)I::get($this->getHeaders(), $name, [])); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /** |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | if (isset($_POST[$this->__methodParam]) && !in_array($method = strtoupper($_POST[$this->__methodParam]), ['GET', 'HEAD', 'OPTIONS'])) { |
| 116 | 116 | return $method; |
| 117 | 117 | } |
| 118 | - if ($method = (string) I::get($this->getHeaders(), 'x-http-method-override')) { |
|
| 118 | + if ($method = (string)I::get($this->getHeaders(), 'x-http-method-override')) { |
|
| 119 | 119 | return strtoupper($method); |
| 120 | 120 | } |
| 121 | 121 | if (isset($_SERVER['REQUEST_METHOD'])) { |
@@ -417,7 +417,7 @@ discard block |
||
| 417 | 417 | $secure = $this->isSecureConnection(); |
| 418 | 418 | $http = $secure ? 'https' : 'http'; |
| 419 | 419 | if (I::get($this->getHeaders(), 'x-forwarded-host')) { |
| 420 | - $this->__hostInfo = $http . '://' . trim((string) Arrays::first(explode(',', $this->getHeader('x-forwarded-host')))); |
|
| 420 | + $this->__hostInfo = $http . '://' . trim((string)Arrays::first(explode(',', $this->getHeader('x-forwarded-host')))); |
|
| 421 | 421 | } elseif (I::get($this->getHeaders(), 'host')) { |
| 422 | 422 | $this->__hostInfo = $http . '://' . $this->getHeader('host'); |
| 423 | 423 | } elseif (isset($_SERVER['SERVER_NAME'])) { |
@@ -617,7 +617,7 @@ discard block |
||
| 617 | 617 | */ |
| 618 | 618 | public function getQueryString() |
| 619 | 619 | { |
| 620 | - return (string) I::get($_SERVER, 'QUERY_STRING', ''); |
|
| 620 | + return (string)I::get($_SERVER, 'QUERY_STRING', ''); |
|
| 621 | 621 | } |
| 622 | 622 | |
| 623 | 623 | /** |
@@ -650,7 +650,7 @@ discard block |
||
| 650 | 650 | */ |
| 651 | 651 | public function getServerName() |
| 652 | 652 | { |
| 653 | - return (string) I::get($_SERVER, 'SERVER_NAME'); |
|
| 653 | + return (string)I::get($_SERVER, 'SERVER_NAME'); |
|
| 654 | 654 | } |
| 655 | 655 | |
| 656 | 656 | /** |
@@ -660,7 +660,7 @@ discard block |
||
| 660 | 660 | */ |
| 661 | 661 | public function getServerPort() |
| 662 | 662 | { |
| 663 | - return (int) I::get($_SERVER, 'SERVER_PORT'); |
|
| 663 | + return (int)I::get($_SERVER, 'SERVER_PORT'); |
|
| 664 | 664 | } |
| 665 | 665 | |
| 666 | 666 | /** |
@@ -715,7 +715,7 @@ discard block |
||
| 715 | 715 | */ |
| 716 | 716 | public function getRemoteIP() |
| 717 | 717 | { |
| 718 | - return (string) I::get($_SERVER, 'REMOTE_ADDR'); |
|
| 718 | + return (string)I::get($_SERVER, 'REMOTE_ADDR'); |
|
| 719 | 719 | } |
| 720 | 720 | |
| 721 | 721 | /** |
@@ -725,7 +725,7 @@ discard block |
||
| 725 | 725 | */ |
| 726 | 726 | public function getRemoteHost() |
| 727 | 727 | { |
| 728 | - return (string) I::get($_SERVER, 'REMOTE_HOST'); |
|
| 728 | + return (string)I::get($_SERVER, 'REMOTE_HOST'); |
|
| 729 | 729 | } |
| 730 | 730 | |
| 731 | 731 | /** |
@@ -75,7 +75,7 @@ |
||
| 75 | 75 | $request = new Request(); |
| 76 | 76 | if (is_array($url)) { |
| 77 | 77 | $params = $url; |
| 78 | - $anchor = (string) I::get($url, '#', ''); |
|
| 78 | + $anchor = (string)I::get($url, '#', ''); |
|
| 79 | 79 | unset($params['#']); |
| 80 | 80 | $route = trim($params[0], '/'); |
| 81 | 81 | unset($params[0]); |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | $group = null; |
| 110 | 110 | continue; |
| 111 | 111 | } |
| 112 | - list($name, $value) = Arrays::lists(explode('=', $line), 2, function ($row) { |
|
| 112 | + list($name, $value) = Arrays::lists(explode('=', $line), 2, function($row) { |
|
| 113 | 113 | return trim($row); |
| 114 | 114 | }); |
| 115 | 115 | $array[$name] = $value; |
@@ -120,15 +120,15 @@ discard block |
||
| 120 | 120 | if (null === $group) { |
| 121 | 121 | $return = Arrays::merge($return, $array); |
| 122 | 122 | } else { |
| 123 | - $return[$group] = Arrays::merge((array) I::get($return, $group, []), $array); |
|
| 123 | + $return[$group] = Arrays::merge((array)I::get($return, $group, []), $array); |
|
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | 126 | } elseif (self::TYPE_JSON === $this->_type) { |
| 127 | 127 | $content = $local->getFileContent($this->_file); |
| 128 | - $return = Json::decode((string) $content); |
|
| 128 | + $return = Json::decode((string)$content); |
|
| 129 | 129 | } elseif (self::TYPE_XML === $this->_type) { |
| 130 | 130 | $content = $local->getFileContent($this->_file); |
| 131 | - $return = Xml::toArray((string) $content); |
|
| 131 | + $return = Xml::toArray((string)$content); |
|
| 132 | 132 | } |
| 133 | 133 | return $return; |
| 134 | 134 | } |
@@ -203,7 +203,7 @@ |
||
| 203 | 203 | } elseif (false === $asFrame) { |
| 204 | 204 | self::send('X-Frame-Options: deny'); |
| 205 | 205 | } else { |
| 206 | - $asFrame = (string) $asFrame; |
|
| 206 | + $asFrame = (string)$asFrame; |
|
| 207 | 207 | self::send('X-Frame-Options: allow-from ' . $asFrame); |
| 208 | 208 | } |
| 209 | 209 | } |
@@ -166,8 +166,4 @@ |
||
| 166 | 166 | $local->putFileContent($file, <<<EOT |
| 167 | 167 | <?php |
| 168 | 168 | |
| 169 | -return {$array}; |
|
| 170 | - |
|
| 171 | -EOT); |
|
| 172 | - } |
|
| 173 | -} |
|
| 169 | +return {$array} |
|
| 174 | 170 | \ No newline at end of file |
@@ -166,8 +166,4 @@ |
||
| 166 | 166 | $local->putFileContent($file, <<<EOT |
| 167 | 167 | <?php |
| 168 | 168 | |
| 169 | -return {$array}; |
|
| 170 | - |
|
| 171 | -EOT); |
|
| 172 | - } |
|
| 173 | -} |
|
| 169 | +return {$array} |
|
| 174 | 170 | \ No newline at end of file |
@@ -166,8 +166,4 @@ |
||
| 166 | 166 | $local->putFileContent($file, <<<EOT |
| 167 | 167 | <?php |
| 168 | 168 | |
| 169 | -return {$array}; |
|
| 170 | - |
|
| 171 | -EOT); |
|
| 172 | - } |
|
| 173 | -} |
|
| 169 | +return {$array} |
|
| 174 | 170 | \ No newline at end of file |
@@ -166,8 +166,4 @@ |
||
| 166 | 166 | $local->putFileContent($file, <<<EOT |
| 167 | 167 | <?php |
| 168 | 168 | |
| 169 | -return {$array}; |
|
| 170 | - |
|
| 171 | -EOT); |
|
| 172 | - } |
|
| 173 | -} |
|
| 169 | +return {$array} |
|
| 174 | 170 | \ No newline at end of file |
@@ -166,8 +166,4 @@ |
||
| 166 | 166 | $local->putFileContent($file, <<<EOT |
| 167 | 167 | <?php |
| 168 | 168 | |
| 169 | -return {$array}; |
|
| 170 | - |
|
| 171 | -EOT); |
|
| 172 | - } |
|
| 173 | -} |
|
| 169 | +return {$array} |
|
| 174 | 170 | \ No newline at end of file |