@@ -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 | } |
@@ -223,8 +223,8 @@ discard block |
||
| 223 | 223 | if ($start && $end) { |
| 224 | 224 | $year = DateTime::createFromFormat($format, $value)->format('Y'); |
| 225 | 225 | |
| 226 | - if ($year < $start || $year > $end) { |
|
| 227 | - $msg = $msg ?: 'this field must be between ' . $start . ' and ' . $end; |
|
| 226 | + if ($year < $start || $year > $end) { |
|
| 227 | + $msg = $msg ?: 'this field must be between ' . $start . ' and ' . $end; |
|
| 228 | 228 | |
| 229 | 229 | $this->addError($this->input, $msg); |
| 230 | 230 | |
@@ -370,14 +370,14 @@ discard block |
||
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | if (is_array($excepts->languages)) { |
| 373 | - foreach($excepts->languages as $language) { |
|
| 373 | + foreach ($excepts->languages as $language) { |
|
| 374 | 374 | $langsRegex .= $this->languages(trim($language)); |
| 375 | 375 | $languages .= "$language, "; |
| 376 | 376 | } |
| 377 | 377 | $languages = rtrim($languages, ", "); |
| 378 | 378 | } else if (is_string($excepts->languages)) { |
| 379 | 379 | if (preg_match('/,/', $excepts->languages) && preg_match_all('/,/', $excepts->languages)) { |
| 380 | - foreach(explode(',', $excepts->languages) as $language) { |
|
| 380 | + foreach (explode(',', $excepts->languages) as $language) { |
|
| 381 | 381 | $langsRegex .= $this->languages(trim($language)); |
| 382 | 382 | $languages .= "$language, "; |
| 383 | 383 | } |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | $splitChars = str_split($splitChars); |
| 411 | 411 | $splitChars = "\\" . implode('|\\', $splitChars); |
| 412 | 412 | } |
| 413 | - $re2 = "/^($splitChars"."|\\s+\\$splitChars)/"; |
|
| 413 | + $re2 = "/^($splitChars" . "|\\s+\\$splitChars)/"; |
|
| 414 | 414 | if (preg_match_all($re2, $value)) { |
| 415 | 415 | $msg = $msg ?: 'charachters cant be in the first'; |
| 416 | 416 | |
@@ -425,7 +425,7 @@ discard block |
||
| 425 | 425 | $splitChars = str_split($splitChars); |
| 426 | 426 | $splitChars = "\\" . implode('|\\', $splitChars); |
| 427 | 427 | } |
| 428 | - $re3 = "/($splitChars"."|\\$splitChars\\s+)$/"; |
|
| 428 | + $re3 = "/($splitChars" . "|\\$splitChars\\s+)$/"; |
|
| 429 | 429 | if (preg_match_all($re3, $value)) { |
| 430 | 430 | $msg = $msg ?: 'charachters cant be in the end'; |
| 431 | 431 | |
@@ -461,8 +461,8 @@ discard block |
||
| 461 | 461 | |
| 462 | 462 | $re5 = "/^[0-9\\s$chars$langsRegex]*$/u"; |
| 463 | 463 | if (!preg_match($re5, $value)) { |
| 464 | - $chars = explode('\\', $chars); |
|
| 465 | - $chars = implode('', $chars); |
|
| 464 | + $chars = explode('\\', $chars); |
|
| 465 | + $chars = implode('', $chars); |
|
| 466 | 466 | $chars = $chars ? "[ $chars ] and" : ''; |
| 467 | 467 | $languages = $languages ? "[ $languages ]" : ''; |
| 468 | 468 | $msg = $msg ?: "just $chars $languages letters can be used"; |
@@ -519,7 +519,7 @@ discard block |
||
| 519 | 519 | $files = []; |
| 520 | 520 | $final = []; |
| 521 | 521 | |
| 522 | - foreach($characters as $key => $character) { |
|
| 522 | + foreach ($characters as $key => $character) { |
|
| 523 | 523 | if (strpos($character, 'path:') === 0) { |
| 524 | 524 | unset($characters[$key]); |
| 525 | 525 | |
@@ -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; |