@@ -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(), |
@@ -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 |
@@ -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 |
@@ -53,7 +53,7 @@ |
||
53 | 53 | case 'web': |
54 | 54 | return WebAuth::getInstance($authService, new Mailer, new Hasher); |
55 | 55 | case 'api': |
56 | - $jwt = (new JWToken())->setLeeway(1)->setClaims((array)config()->get('auth.claims')); |
|
56 | + $jwt = (new JWToken())->setLeeway(1)->setClaims((array) config()->get('auth.claims')); |
|
57 | 57 | return ApiAuth::getInstance($authService, new Mailer, new Hasher, $jwt); |
58 | 58 | } |
59 | 59 | } else { |