@@ -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 | } |
@@ -63,7 +63,7 @@ |
||
63 | 63 | // just to make sure that the passed query string parameter page |
64 | 64 | // must be number and should be more or equal than 1 |
65 | 65 | |
66 | - if (!is_numeric($page) OR $page < 1) { |
|
66 | + if (!is_numeric($page) or $page < 1) { |
|
67 | 67 | |
68 | 68 | $page = 1; |
69 | 69 | } |
@@ -42,7 +42,9 @@ |
||
42 | 42 | |
43 | 43 | $user = $this->where('code = ? ', $code)->fetch($this->table); |
44 | 44 | |
45 | - if (!$user) return false; |
|
45 | + if (!$user) { |
|
46 | + return false; |
|
47 | + } |
|
46 | 48 | |
47 | 49 | $this->user = $user; |
48 | 50 |
@@ -82,7 +82,8 @@ |
||
82 | 82 | ', $this->table, [['address', 'id', 'user_id'], ['activity', 'id', 'user_id']])->where($sql, $wheres)->orderBy('users.registration', 'DESC')->fetchAll(); |
83 | 83 | } |
84 | 84 | |
85 | - public function insert() { |
|
85 | + public function insert() |
|
86 | + { |
|
86 | 87 | |
87 | 88 | } |
88 | 89 | } |
@@ -23,9 +23,13 @@ |
||
23 | 23 | ]; |
24 | 24 | |
25 | 25 | if ($login->isLogged()) { |
26 | - if (in_array($request, $pagesWhenLogout)) return $app->url->redirectTo('/admin'); |
|
26 | + if (in_array($request, $pagesWhenLogout)) { |
|
27 | + return $app->url->redirectTo('/admin'); |
|
28 | + } |
|
27 | 29 | } else { |
28 | - if (!in_array($request, $pagesWhenLogout)) return $app->url->redirectTo('/admin/login'); |
|
30 | + if (!in_array($request, $pagesWhenLogout)) { |
|
31 | + return $app->url->redirectTo('/admin/login'); |
|
32 | + } |
|
29 | 33 | } |
30 | 34 | return $next; |
31 | 35 | } |
@@ -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 | } |
@@ -9,7 +9,9 @@ |
||
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'])) { |
|
13 | + return $app->url->redirectTo('404'); |
|
14 | + } |
|
13 | 15 | return $next; |
14 | 16 | } |
15 | 17 | } |
@@ -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']); |
@@ -215,7 +215,9 @@ discard block |
||
215 | 215 | |
216 | 216 | $current_value = $this->db->select($name)->from($table)->where($user_id_table_name . ' = ?', [$id])->fetch()->$name; |
217 | 217 | |
218 | - if ($value == '') $value = null; |
|
218 | + if ($value == '') { |
|
219 | + $value = null; |
|
220 | + } |
|
219 | 221 | |
220 | 222 | if (($current_value === strtolower($value)) || ($value == null && $current_value == null)) { |
221 | 223 | $msg['same'] = $value ? strtolower($value) : ''; |
@@ -246,7 +248,9 @@ discard block |
||
246 | 248 | return json_encode($msg); |
247 | 249 | } |
248 | 250 | |
249 | - if (isset($filters->date)) $value = date('Y-m-d', strtotime($value)); |
|
251 | + if (isset($filters->date)) { |
|
252 | + $value = date('Y-m-d', strtotime($value)); |
|
253 | + } |
|
250 | 254 | |
251 | 255 | $update = $this->db->data($name, $value)->where($user_id_table_name . ' = ?', $id)->update($table); |
252 | 256 |
@@ -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))) { |
@@ -33,7 +33,9 @@ |
||
33 | 33 | $app->pages->add('not found', '/404', 'fas fa-times'); |
34 | 34 | |
35 | 35 | // == Website's routes |
36 | -if ($app->request->isRequestToAdminManagement()) return; |
|
36 | +if ($app->request->isRequestToAdminManagement()) { |
|
37 | + return; |
|
38 | +} |
|
37 | 39 | |
38 | 40 | $app->route->add('/', 'Website/Home'); |
39 | 41 | $app->route->add('/home', 'Website/Home', 'GET'); |