@@ -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 |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public static function setup() |
68 | 68 | { |
69 | - set_error_handler(function ($severity, $message, $file, $line) { |
|
69 | + set_error_handler(function($severity, $message, $file, $line) { |
|
70 | 70 | |
71 | 71 | if (!(error_reporting() && $severity)) { |
72 | 72 | return; |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | throw new ErrorException($message, 0, $severity, $file, $line); |
76 | 76 | }); |
77 | 77 | |
78 | - set_exception_handler(function (Throwable $e) { |
|
78 | + set_exception_handler(function(Throwable $e) { |
|
79 | 79 | self::handle($e); |
80 | 80 | }); |
81 | 81 | } |
@@ -42,11 +42,11 @@ discard block |
||
42 | 42 | $error = false; |
43 | 43 | |
44 | 44 | if (function_exists('mb_strlen')) { |
45 | - if (mb_strlen($value) < (int)$param) { |
|
45 | + if (mb_strlen($value) < (int) $param) { |
|
46 | 46 | $error = true; |
47 | 47 | } |
48 | 48 | } else { |
49 | - if (strlen($value) < (int)$param) { |
|
49 | + if (strlen($value) < (int) $param) { |
|
50 | 50 | $error = true; |
51 | 51 | } |
52 | 52 | } |
@@ -70,11 +70,11 @@ discard block |
||
70 | 70 | $error = false; |
71 | 71 | |
72 | 72 | if (function_exists('mb_strlen')) { |
73 | - if (mb_strlen($value) > (int)$param) { |
|
73 | + if (mb_strlen($value) > (int) $param) { |
|
74 | 74 | $error = true; |
75 | 75 | } |
76 | 76 | } else { |
77 | - if (strlen($value) > (int)$param) { |
|
77 | + if (strlen($value) > (int) $param) { |
|
78 | 78 | $error = true; |
79 | 79 | } |
80 | 80 | } |
@@ -99,11 +99,11 @@ discard block |
||
99 | 99 | $error = false; |
100 | 100 | |
101 | 101 | if (function_exists('mb_strlen')) { |
102 | - if (mb_strlen($value) !== (int)$param) { |
|
102 | + if (mb_strlen($value) !== (int) $param) { |
|
103 | 103 | $error = true; |
104 | 104 | } |
105 | 105 | } else { |
106 | - if (strlen($value) !== (int)$param) { |
|
106 | + if (strlen($value) !== (int) $param) { |
|
107 | 107 | $error = true; |
108 | 108 | } |
109 | 109 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | protected function containsList(string $field, string $value, array $param) |
63 | 63 | { |
64 | 64 | if (!empty($value)) { |
65 | - $param = array_map(function ($param) { |
|
65 | + $param = array_map(function($param) { |
|
66 | 66 | return trim(strtolower($param)); |
67 | 67 | }, $param); |
68 | 68 | |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | protected function doesntContainsList(string $field, string $value, array $param) |
84 | 84 | { |
85 | 85 | if (!empty($value)) { |
86 | - $param = array_map(function ($param) { |
|
86 | + $param = array_map(function($param) { |
|
87 | 87 | return trim(strtolower($param)); |
88 | 88 | }, $param); |
89 | 89 |
@@ -140,7 +140,7 @@ |
||
140 | 140 | public function user(): ?User |
141 | 141 | { |
142 | 142 | try { |
143 | - $accessToken = base64_decode((string)Request::getAuthorizationBearer()); |
|
143 | + $accessToken = base64_decode((string) Request::getAuthorizationBearer()); |
|
144 | 144 | return (new User())->setData($this->jwt->retrieve($accessToken)->fetchData()); |
145 | 145 | } catch (\Exception $e) { |
146 | 146 | if (Request::hasHeader($this->keyFields[self::REFRESH_TOKEN_KEY])) { |
@@ -75,7 +75,7 @@ |
||
75 | 75 | $currentMiddleware = new $middlewareClass($request, $response); |
76 | 76 | |
77 | 77 | if ($currentMiddleware instanceof QtMiddleware) { |
78 | - list($modifiedRequest, $modifiedResponse) = $currentMiddleware->apply($request, $response, function ($request, $response) { |
|
78 | + list($modifiedRequest, $modifiedResponse) = $currentMiddleware->apply($request, $response, function($request, $response) { |
|
79 | 79 | next($this->middlewares); |
80 | 80 | return [$request, $response]; |
81 | 81 | }); |
@@ -45,7 +45,7 @@ |
||
45 | 45 | */ |
46 | 46 | public static function generateToken(SessionStorageInterface $storage, string $key): ?string |
47 | 47 | { |
48 | - if (!self::$token ) { |
|
48 | + if (!self::$token) { |
|
49 | 49 | self::deleteToken($storage); |
50 | 50 | self::$token = base64_encode($key); |
51 | 51 | self::setToken($storage, self::$token); |
@@ -18,7 +18,6 @@ |
||
18 | 18 | /** |
19 | 19 | * Class Request |
20 | 20 | * @package Quantum\Http |
21 | - |
|
22 | 21 | * @method static void create(string $method, string $url, array $data = null, array $file = null) |
23 | 22 | * @method static void flush() |
24 | 23 | * @method static string|null getMethod() |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $getParams = []; |
37 | 37 | |
38 | 38 | if (!empty($_GET)) { |
39 | - $getParams = filter_input_array(INPUT_GET, FILTER_DEFAULT) ?: [] ; |
|
39 | + $getParams = filter_input_array(INPUT_GET, FILTER_DEFAULT) ?: []; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | return $getParams; |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | if (strpos($block, 'filename') !== false) { |
173 | 173 | list($nameParam, $file) = self::getParsedFile($block); |
174 | 174 | |
175 | - if(!$file) { |
|
175 | + if (!$file) { |
|
176 | 176 | continue; |
177 | 177 | } |
178 | 178 | |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | { |
225 | 225 | list($name, $filename, $type, $content) = self::parseFileData($block); |
226 | 226 | |
227 | - if(!$content) { |
|
227 | + if (!$content) { |
|
228 | 228 | return null; |
229 | 229 | } |
230 | 230 | |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | 'size' => $fs->size($tempName), |
243 | 243 | ]); |
244 | 244 | |
245 | - register_shutdown_function(function () use ($fs, $tempName) { |
|
245 | + register_shutdown_function(function() use ($fs, $tempName) { |
|
246 | 246 | $fs->remove($tempName); |
247 | 247 | }); |
248 | 248 |