@@ -20,7 +20,7 @@ |
||
20 | 20 | |
21 | 21 | if ($this->form->handle(new Auth\Controller\Reset())) { |
22 | 22 | |
23 | - Request::redirect(INSTALL_PATH . (Auth::admin() ? '/admin' : '/profile') . '/login?submitted=reset'); |
|
23 | + Request::redirect(INSTALL_PATH.(Auth::admin() ? '/admin' : '/profile').'/login?submitted=reset'); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | # ------------------------ |
@@ -20,7 +20,7 @@ |
||
20 | 20 | |
21 | 21 | if ($this->form->handle(new Auth\Controller\Login())) { |
22 | 22 | |
23 | - Request::redirect(INSTALL_PATH . (Auth::admin() ? '/admin' : '/profile')); |
|
23 | + Request::redirect(INSTALL_PATH.(Auth::admin() ? '/admin' : '/profile')); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | # Display success message |
@@ -85,9 +85,9 @@ |
||
85 | 85 | |
86 | 86 | $set = array_merge($this->getStatements('fieldStatement'), $this->getStatements('keyStatement')); |
87 | 87 | |
88 | - $query = ("CREATE TABLE IF NOT EXISTS `" . static::$table . "`") . |
|
88 | + $query = ("CREATE TABLE IF NOT EXISTS `".static::$table."`"). |
|
89 | 89 | |
90 | - ("(" . implode(", ", $set) . ") ENGINE=InnoDB DEFAULT CHARSET=utf8"); |
|
90 | + ("(".implode(", ", $set).") ENGINE=InnoDB DEFAULT CHARSET=utf8"); |
|
91 | 91 | |
92 | 92 | # ------------------------ |
93 | 93 |
@@ -12,7 +12,9 @@ discard block |
||
12 | 12 | |
13 | 13 | private function addParam(Param $param) { |
14 | 14 | |
15 | - if (('' === ($name = $param->name())) || isset($this->params[$name]) || isset($this->implementors[$name])) return; |
|
15 | + if (('' === ($name = $param->name())) || isset($this->params[$name]) || isset($this->implementors[$name])) { |
|
16 | + return; |
|
17 | + } |
|
16 | 18 | |
17 | 19 | $this->params[$name] = $param; |
18 | 20 | } |
@@ -26,7 +28,9 @@ discard block |
||
26 | 28 | |
27 | 29 | foreach ($this->params as $param) { |
28 | 30 | |
29 | - if (false !== ($statement = $param->$method())) $statements[] = $statement; |
|
31 | + if (false !== ($statement = $param->$method())) { |
|
32 | + $statements[] = $statement; |
|
33 | + } |
|
30 | 34 | } |
31 | 35 | |
32 | 36 | # ------------------------ |
@@ -63,7 +67,9 @@ discard block |
||
63 | 67 | |
64 | 68 | protected function addOrderer(string $name, bool $descending = false) { |
65 | 69 | |
66 | - if (!isset($this->params[$name]) || isset($this->orderers[$name])) return; |
|
70 | + if (!isset($this->params[$name]) || isset($this->orderers[$name])) { |
|
71 | + return; |
|
72 | + } |
|
67 | 73 | |
68 | 74 | $this->orderers[$name] = $descending; |
69 | 75 | } |
@@ -72,7 +78,9 @@ discard block |
||
72 | 78 | |
73 | 79 | protected function addImplementor(string $name, callable $callback) { |
74 | 80 | |
75 | - if (('' === $name) || isset($this->params[$name]) || isset($this->implementors[$name])) return; |
|
81 | + if (('' === $name) || isset($this->params[$name]) || isset($this->implementors[$name])) { |
|
82 | + return; |
|
83 | + } |
|
76 | 84 | |
77 | 85 | $this->implementors[$name] = $callback; |
78 | 86 | } |
@@ -141,14 +149,18 @@ discard block |
||
141 | 149 | |
142 | 150 | if ($process_id) { |
143 | 151 | |
144 | - if (isset($data['id'])) $result['id'] = $this->id->cast($data['id']); |
|
152 | + if (isset($data['id'])) { |
|
153 | + $result['id'] = $this->id->cast($data['id']); |
|
154 | + } |
|
145 | 155 | } |
146 | 156 | |
147 | 157 | # Cast params |
148 | 158 | |
149 | 159 | foreach ($this->params as $name => $param) { |
150 | 160 | |
151 | - if (isset($data[$name])) $result[$name] = $param->cast($data[$name]); |
|
161 | + if (isset($data[$name])) { |
|
162 | + $result[$name] = $param->cast($data[$name]); |
|
163 | + } |
|
152 | 164 | } |
153 | 165 | |
154 | 166 | # ------------------------ |
@@ -12,7 +12,7 @@ |
||
12 | 12 | |
13 | 13 | private function getFullName() { |
14 | 14 | |
15 | - return trim($this->data['first_name'] . ' ' . $this->data['last_name']); |
|
15 | + return trim($this->data['first_name'].' '.$this->data['last_name']); |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | # Implement entity |
@@ -35,7 +35,7 @@ |
||
35 | 35 | |
36 | 36 | if ($this->form->handle(new Install\Controller\Database())) { |
37 | 37 | |
38 | - Request::redirect(INSTALL_PATH . '/admin/register'); |
|
38 | + Request::redirect(INSTALL_PATH.'/admin/register'); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | # ------------------------ |
@@ -18,7 +18,7 @@ |
||
18 | 18 | |
19 | 19 | $class = ($value ? 'positive' : 'negative'); $icon = ($value ? 'check circle' : 'warning circle'); |
20 | 20 | |
21 | - $text = Language::get('INSTALL_REQUIREMENT_' . strtoupper($name) . '_' . ($value ? 'SUCCESS' : 'FAIL')); |
|
21 | + $text = Language::get('INSTALL_REQUIREMENT_'.strtoupper($name).'_'.($value ? 'SUCCESS' : 'FAIL')); |
|
22 | 22 | |
23 | 23 | $requirements[] = ['class' => $class, 'icon' => $icon, 'text' => $text]; |
24 | 24 | } |
@@ -14,7 +14,7 @@ |
||
14 | 14 | |
15 | 15 | $checked = (Install::status() && Validate::boolean(Request::get('checked'))); |
16 | 16 | |
17 | - $class = ('Handlers\Admin\Install\\' . (!$checked ? 'Check' : 'Database')); |
|
17 | + $class = ('Handlers\Admin\Install\\'.(!$checked ? 'Check' : 'Database')); |
|
18 | 18 | |
19 | 19 | # ------------------------ |
20 | 20 |
@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | # Customize captcha |
26 | 26 | |
27 | - $font = (DIR_SYSTEM_DATA . CONFIG_CAPTCHA_FONT); $size = CONFIG_CAPTCHA_FONT_SIZE; |
|
27 | + $font = (DIR_SYSTEM_DATA.CONFIG_CAPTCHA_FONT); $size = CONFIG_CAPTCHA_FONT_SIZE; |
|
28 | 28 | |
29 | 29 | $indent = CONFIG_CAPTCHA_TEXT_INDENT; $step = CONFIG_CAPTCHA_TEXT_STEP; |
30 | 30 |
@@ -41,7 +41,7 @@ |
||
41 | 41 | |
42 | 42 | # Reset data |
43 | 43 | |
44 | - $this->id = 0; $this->data = $this->definition->implement(); |
|
44 | + $this->id = 0; $this->data = $this->definition->implement(); |
|
45 | 45 | |
46 | 46 | # Reset path |
47 | 47 |
@@ -12,13 +12,19 @@ discard block |
||
12 | 12 | |
13 | 13 | public function remove() { |
14 | 14 | |
15 | - if (0 === $this->id) return false; |
|
15 | + if (0 === $this->id) { |
|
16 | + return false; |
|
17 | + } |
|
16 | 18 | |
17 | 19 | # Check if entity is removable |
18 | 20 | |
19 | - if (static::$super && ($this->id === 1)) return false; |
|
21 | + if (static::$super && ($this->id === 1)) { |
|
22 | + return false; |
|
23 | + } |
|
20 | 24 | |
21 | - if (static::$nesting && (0 !== $this->children())) return false; |
|
25 | + if (static::$nesting && (0 !== $this->children())) { |
|
26 | + return false; |
|
27 | + } |
|
22 | 28 | |
23 | 29 | # Remove extension entries |
24 | 30 | |
@@ -26,18 +32,24 @@ discard block |
||
26 | 32 | |
27 | 33 | $entity = self::get($extension, $this->id); |
28 | 34 | |
29 | - if ($entity->error() || ((0 !== $entity->id) && !$entity->remove())) return false; |
|
35 | + if ($entity->error() || ((0 !== $entity->id) && !$entity->remove())) { |
|
36 | + return false; |
|
37 | + } |
|
30 | 38 | } |
31 | 39 | |
32 | 40 | # Remove entity |
33 | 41 | |
34 | 42 | DB::delete(static::$table, ['id' => $this->id]); |
35 | 43 | |
36 | - if (!(DB::last() && DB::last()->status)) return false; |
|
44 | + if (!(DB::last() && DB::last()->status)) { |
|
45 | + return false; |
|
46 | + } |
|
37 | 47 | |
38 | 48 | # Uncache entity |
39 | 49 | |
40 | - if (self::$cache[static::$type][$this->id] === $this) unset(self::$cache[static::$type][$this->id]); |
|
50 | + if (self::$cache[static::$type][$this->id] === $this) { |
|
51 | + unset(self::$cache[static::$type][$this->id]); |
|
52 | + } |
|
41 | 53 | |
42 | 54 | # Reset data |
43 | 55 | |
@@ -45,7 +57,9 @@ discard block |
||
45 | 57 | |
46 | 58 | # Reset path |
47 | 59 | |
48 | - if (static::$nesting) $this->data['path'] = []; |
|
60 | + if (static::$nesting) { |
|
61 | + $this->data['path'] = []; |
|
62 | + } |
|
49 | 63 | |
50 | 64 | # Implement entity |
51 | 65 |