@@ -83,7 +83,7 @@ |
||
83 | 83 | $currentMiddleware = new $middlewareClass(); |
84 | 84 | |
85 | 85 | if ($currentMiddleware instanceof QtMiddleware) { |
86 | - list($modifiedRequest, $modifiedResponse) = $currentMiddleware->apply($request, $response, function ($request, $response) { |
|
86 | + list($modifiedRequest, $modifiedResponse) = $currentMiddleware->apply($request, $response, function($request, $response) { |
|
87 | 87 | next($this->middlewares); |
88 | 88 | return [$request, $response]; |
89 | 89 | }); |
@@ -96,7 +96,7 @@ |
||
96 | 96 | function _message($subject, $params) |
97 | 97 | { |
98 | 98 | if (is_array($params)) { |
99 | - return preg_replace_callback('/{%\d+}/', function () use (&$params) { |
|
99 | + return preg_replace_callback('/{%\d+}/', function() use (&$params) { |
|
100 | 100 | return array_shift($params); |
101 | 101 | }, $subject); |
102 | 102 | } else { |
@@ -92,8 +92,9 @@ |
||
92 | 92 | array_pop($blocks); |
93 | 93 | |
94 | 94 | foreach ($blocks as $id => $block) { |
95 | - if (empty($block)) |
|
96 | - continue; |
|
95 | + if (empty($block)) { |
|
96 | + continue; |
|
97 | + } |
|
97 | 98 | if (strpos($block, 'application/octet-stream') !== false) { |
98 | 99 | preg_match("/name=\"([^\"]*)\".*stream[\n|\r]+([^\n\r].*)?$/s", $block, $matches); |
99 | 100 | if (count($matches) > 0) { |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | 'module' => $this->module |
90 | 90 | ]; |
91 | 91 | |
92 | - if(is_callable($params[0])) { |
|
92 | + if (is_callable($params[0])) { |
|
93 | 93 | $this->currentRoute['callback'] = $params[0]; |
94 | 94 | } else { |
95 | 95 | $this->currentRoute['controller'] = $params[0]; |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | public function get($route, ...$params) |
114 | 114 | { |
115 | - return $this->add($route,'GET', ...$params); |
|
115 | + return $this->add($route, 'GET', ...$params); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | /** |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | public function post($route, ...$params) |
125 | 125 | { |
126 | - return $this->add($route,'POST', ...$params); |
|
126 | + return $this->add($route, 'POST', ...$params); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | /** |
@@ -209,7 +209,7 @@ |
||
209 | 209 | private function fetch() |
210 | 210 | { |
211 | 211 | if ($this->curl instanceof MultiCurl) { |
212 | - $this->curl->complete(function ($instance) { |
|
212 | + $this->curl->complete(function($instance) { |
|
213 | 213 | if ($instance->error) { |
214 | 214 | $this->errors[] = [ |
215 | 215 | 'code' => $instance->getErrorCode(), |
@@ -25,7 +25,7 @@ |
||
25 | 25 | ]; |
26 | 26 | |
27 | 27 | if (config()->get('debug') && !$die) { |
28 | - $debugOutput = (array)session()->get('_qt_debug_output') ?? []; |
|
28 | + $debugOutput = (array) session()->get('_qt_debug_output') ?? []; |
|
29 | 29 | array_push($debugOutput, $var); |
30 | 30 | session()->set('_qt_debug_output', $debugOutput); |
31 | 31 | } else { |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | |
77 | 77 | self::$__query = self::$server->query(); |
78 | 78 | |
79 | - self::$__headers = array_change_key_case((array)getallheaders(), CASE_LOWER); |
|
79 | + self::$__headers = array_change_key_case((array) getallheaders(), CASE_LOWER); |
|
80 | 80 | |
81 | 81 | self::$__request = array_merge( |
82 | 82 | self::$__request, |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | $csrfToken = null; |
214 | 214 | |
215 | 215 | if (self::has('token')) { |
216 | - $csrfToken = (string)self::get('token'); |
|
216 | + $csrfToken = (string) self::get('token'); |
|
217 | 217 | } elseif (self::hasHeader('X-csrf-token')) { |
218 | 218 | $csrfToken = self::getHeader('X-csrf-token'); |
219 | 219 | } |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | { |
230 | 230 | $bearerToken = null; |
231 | 231 | |
232 | - $authorization = (string)self::getHeader('Authorization'); |
|
232 | + $authorization = (string) self::getHeader('Authorization'); |
|
233 | 233 | |
234 | 234 | if (self::hasHeader('Authorization')) { |
235 | 235 | if (preg_match('/Bearer\s(\S+)/', $authorization, $matches)) { |
@@ -78,7 +78,7 @@ |
||
78 | 78 | } |
79 | 79 | } |
80 | 80 | |
81 | - return (array)$inputParams; |
|
81 | + return (array) $inputParams; |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | } |
85 | 85 | \ No newline at end of file |
@@ -53,8 +53,7 @@ |
||
53 | 53 | $data = self::$__request[$key]; |
54 | 54 | } else { |
55 | 55 | $data = is_array(self::$__request[$key]) ? |
56 | - filter_var_array(self::$__request[$key], FILTER_SANITIZE_STRING) : |
|
57 | - filter_var(self::$__request[$key], FILTER_SANITIZE_STRING); |
|
56 | + filter_var_array(self::$__request[$key], FILTER_SANITIZE_STRING) : filter_var(self::$__request[$key], FILTER_SANITIZE_STRING); |
|
58 | 57 | } |
59 | 58 | } |
60 | 59 |