@@ -117,7 +117,7 @@ |
||
117 | 117 | { |
118 | 118 | $controller .= strpos($controller, 'Controller') ? '' : 'Controller'; |
119 | 119 | |
120 | - $controller = 'App\\Controllers\\'. $controller; |
|
120 | + $controller = 'App\\Controllers\\' . $controller; |
|
121 | 121 | |
122 | 122 | return $controller; |
123 | 123 | } |
@@ -9,7 +9,7 @@ |
||
9 | 9 | { |
10 | 10 | public function handle(Application $app, $next) |
11 | 11 | { |
12 | - if(empty($_SERVER['HTTP_X_REQUESTED_WITH'])) return $app->url->redirectTo('404'); |
|
12 | + if (empty($_SERVER['HTTP_X_REQUESTED_WITH'])) return $app->url->redirectTo('404'); |
|
13 | 13 | return $next; |
14 | 14 | } |
15 | 15 | } |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | $gender = $posts['gender']; |
322 | 322 | $birthday = date('Y-m-d', strtotime($posts['birthday'])); |
323 | 323 | $email = $posts['email']; |
324 | - $registration = $this->changeFormatDate(microtime(true), ['U.u', 'Y-m-d H:i:s']); |
|
324 | + $registration = $this->changeFormatDate(microtime(true), ['U.u', 'Y-m-d H:i:s']); |
|
325 | 325 | |
326 | 326 | $insertInUser = $this->db->data([ |
327 | 327 | 'id' => $user_id, |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | |
375 | 375 | private function isUserNew($date) |
376 | 376 | { |
377 | - if (!$date) {return;} |
|
377 | + if (!$date) {return; } |
|
378 | 378 | |
379 | 379 | $register_year = $this->changeFormatDate($date, ['Y-m-d H:i:s', 'Y']); |
380 | 380 | $register_month = $this->changeFormatDate($date, ['Y-m-d H:i:s', 'm']); |
@@ -35,8 +35,8 @@ |
||
35 | 35 | return json_encode($msg); |
36 | 36 | } |
37 | 37 | |
38 | - $username = $this->request->post('username'); |
|
39 | - $password = $this->request->post('password'); |
|
38 | + $username = $this->request->post('username'); |
|
39 | + $password = $this->request->post('password'); |
|
40 | 40 | $remember = false; |
41 | 41 | |
42 | 42 | if (in_array('remeberme', array_keys($posts))) { |
@@ -120,17 +120,17 @@ |
||
120 | 120 | */ |
121 | 121 | private function parameters() |
122 | 122 | { |
123 | - $url = $this->app->request->url(); |
|
123 | + $url = $this->app->request->url(); |
|
124 | 124 | |
125 | - if ($url === '/') {return;} |
|
126 | - $parameters = explode('/', $url); |
|
125 | + if ($url === '/') {return; } |
|
126 | + $parameters = explode('/', $url); |
|
127 | 127 | array_shift($parameters); |
128 | 128 | $return = []; |
129 | 129 | |
130 | 130 | foreach ($parameters as $parameter) { |
131 | 131 | $name = $parameter; |
132 | - $length = strpos($url, $parameter) + strlen($parameter); |
|
133 | - $link = substr($url, 0, $length); |
|
132 | + $length = strpos($url, $parameter) + strlen($parameter); |
|
133 | + $link = substr($url, 0, $length); |
|
134 | 134 | |
135 | 135 | $return[] = [ |
136 | 136 | 'name' => $name, |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | { |
29 | 29 | ini_set('session.use_only_cookies', 1); |
30 | 30 | |
31 | - if (! session_id()) session_start(); |
|
31 | + if (!session_id()) session_start(); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * @param mixed $default |
51 | 51 | * @return mixed |
52 | 52 | */ |
53 | - public function get($key , $default = null) |
|
53 | + public function get($key, $default = null) |
|
54 | 54 | { |
55 | 55 | return array_get($_SESSION, $key, $default); |
56 | 56 | } |
@@ -92,7 +92,7 @@ |
||
92 | 92 | { |
93 | 93 | $args = func_get_args()[0]; |
94 | 94 | |
95 | - foreach($args as $join) { |
|
95 | + foreach ($args as $join) { |
|
96 | 96 | $sql[] = $join[0] . ' ON ' . $this->table . '.' . $join[1] . ' = ' . $join[0] . '.' . $join[2]; |
97 | 97 | } |
98 | 98 | $this->joins = $sql; |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | $msg = null; |
224 | 224 | if ($options->start && $options->end) { |
225 | 225 | $method = 'isDateBetween'; |
226 | - $msg = 'this field must be between ' . $options->start . ' and ' . $options->end; |
|
226 | + $msg = 'this field must be between ' . $options->start . ' and ' . $options->end; |
|
227 | 227 | } elseif ($options->start) { |
228 | 228 | $method = 'minimum'; |
229 | 229 | $msg = 'the date can\'t be under ' . $options->start; |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | $method = 'maximum'; |
232 | 232 | $msg = 'the date can\'t be above ' . $options->end; |
233 | 233 | } |
234 | - return array ('method' => $method,'msg'=> $msg); |
|
234 | + return array('method' => $method, 'msg'=> $msg); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | /** |
@@ -346,14 +346,14 @@ discard block |
||
346 | 346 | } |
347 | 347 | |
348 | 348 | if (is_array($excepts->languages)) { |
349 | - foreach($excepts->languages as $language) { |
|
349 | + foreach ($excepts->languages as $language) { |
|
350 | 350 | $langsRegex .= $this->languages(trim($language)); |
351 | 351 | $languages .= "$language, "; |
352 | 352 | } |
353 | 353 | $languages = rtrim($languages, ", "); |
354 | 354 | } else if (is_string($excepts->languages)) { |
355 | 355 | if (preg_match('/,/', $excepts->languages) && preg_match_all('/,/', $excepts->languages)) { |
356 | - foreach(explode(',', $excepts->languages) as $language) { |
|
356 | + foreach (explode(',', $excepts->languages) as $language) { |
|
357 | 357 | $langsRegex .= $this->languages(trim($language)); |
358 | 358 | $languages .= "$language, "; |
359 | 359 | } |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | $splitChars = str_split($splitChars); |
387 | 387 | $splitChars = "\\" . implode('|\\', $splitChars); |
388 | 388 | } |
389 | - $re2 = "/^($splitChars"."|\\s+\\$splitChars)/"; |
|
389 | + $re2 = "/^($splitChars" . "|\\s+\\$splitChars)/"; |
|
390 | 390 | if (preg_match_all($re2, $value)) { |
391 | 391 | $msg = $msg ?: 'charachters cant be in the first'; |
392 | 392 | |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | $splitChars = str_split($splitChars); |
402 | 402 | $splitChars = "\\" . implode('|\\', $splitChars); |
403 | 403 | } |
404 | - $re3 = "/($splitChars"."|\\$splitChars\\s+)$/"; |
|
404 | + $re3 = "/($splitChars" . "|\\$splitChars\\s+)$/"; |
|
405 | 405 | if (preg_match_all($re3, $value)) { |
406 | 406 | $msg = $msg ?: 'charachters cant be in the end'; |
407 | 407 | |
@@ -437,8 +437,8 @@ discard block |
||
437 | 437 | |
438 | 438 | $re5 = "/^[0-9\\s$chars$langsRegex]*$/u"; |
439 | 439 | if (!preg_match($re5, $value)) { |
440 | - $chars = explode('\\', $chars); |
|
441 | - $chars = implode('', $chars); |
|
440 | + $chars = explode('\\', $chars); |
|
441 | + $chars = implode('', $chars); |
|
442 | 442 | $chars = $chars ? "[ $chars ] and" : ''; |
443 | 443 | $languages = $languages ? "[ $languages ]" : ''; |
444 | 444 | $msg = $msg ?: "just $chars $languages letters can be used"; |
@@ -495,7 +495,7 @@ discard block |
||
495 | 495 | $files = []; |
496 | 496 | $final = []; |
497 | 497 | |
498 | - foreach($characters as $key => $character) { |
|
498 | + foreach ($characters as $key => $character) { |
|
499 | 499 | if (strpos($character, 'path:') === 0) { |
500 | 500 | unset($characters[$key]); |
501 | 501 |