@@ -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; |
@@ -125,7 +125,7 @@ |
||
| 125 | 125 | $loopLangs = $comma ? explode(',', $this->languages) : $this->languages; |
| 126 | 126 | $langsRegex = ''; |
| 127 | 127 | $languages = ''; |
| 128 | - foreach($loopLangs as $language) { |
|
| 128 | + foreach ($loopLangs as $language) { |
|
| 129 | 129 | $langsRegex .= $this->languagesArray(trim($language)); |
| 130 | 130 | $languages .= "$language, "; |
| 131 | 131 | } |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | $msg = null; |
| 225 | 225 | if ($options->start && $options->end) { |
| 226 | 226 | $method = 'isDateBetween'; |
| 227 | - $msg = 'this field must be between ' . $options->start . ' and ' . $options->end; |
|
| 227 | + $msg = 'this field must be between ' . $options->start . ' and ' . $options->end; |
|
| 228 | 228 | } elseif ($options->start) { |
| 229 | 229 | $method = 'minimum'; |
| 230 | 230 | $msg = 'the date can\'t be under ' . $options->start; |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | $method = 'maximum'; |
| 233 | 233 | $msg = 'the date can\'t be above ' . $options->end; |
| 234 | 234 | } |
| 235 | - return array ('method' => $method,'msg'=> $msg); |
|
| 235 | + return array('method' => $method, 'msg'=> $msg); |
|
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | /** |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | "value" => $value, |
| 315 | 315 | ]); |
| 316 | 316 | |
| 317 | - foreach($methods as $method => $options) { |
|
| 317 | + foreach ($methods as $method => $options) { |
|
| 318 | 318 | if (call_user_func_array(array($this, $method), $options[0])) { |
| 319 | 319 | $msg = $msg ?: $options[1]; |
| 320 | 320 | $this->addError($this->input, $msg); |
@@ -343,8 +343,8 @@ discard block |
||
| 343 | 343 | |
| 344 | 344 | private function charactersFormatCharsMsg($chars) |
| 345 | 345 | { |
| 346 | - $chars = explode('\\', $chars); |
|
| 347 | - $chars = implode('', $chars); |
|
| 346 | + $chars = explode('\\', $chars); |
|
| 347 | + $chars = implode('', $chars); |
|
| 348 | 348 | $chars = $chars ? "[ $chars ] and" : ''; |
| 349 | 349 | return $chars; |
| 350 | 350 | } |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | { |
| 389 | 389 | if ($atFirst === false) { |
| 390 | 390 | $chars = $this->charactersFormatCharsRegex($chars); |
| 391 | - $re = "/^($chars"."|\\s+\\$chars)/"; |
|
| 391 | + $re = "/^($chars" . "|\\s+\\$chars)/"; |
|
| 392 | 392 | if (preg_match_all($re, $value)) { |
| 393 | 393 | return true; |
| 394 | 394 | } |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | { |
| 401 | 401 | if ($atEnd === false) { |
| 402 | 402 | $chars = $this->charactersFormatCharsRegex($chars); |
| 403 | - $re = "/($chars"."|\\$chars\\s+)$/"; |
|
| 403 | + $re = "/($chars" . "|\\$chars\\s+)$/"; |
|
| 404 | 404 | if (preg_match_all($re, $value)) { |
| 405 | 405 | return true; |
| 406 | 406 | } |
@@ -468,7 +468,7 @@ discard block |
||
| 468 | 468 | $files = []; |
| 469 | 469 | $final = []; |
| 470 | 470 | |
| 471 | - foreach($characters as $key => $character) { |
|
| 471 | + foreach ($characters as $key => $character) { |
|
| 472 | 472 | if (strpos($character, 'path:') === 0) { |
| 473 | 473 | unset($characters[$key]); |
| 474 | 474 | |