@@ -16,7 +16,9 @@ discard block |
||
16 | 16 | |
17 | 17 | $path = implode('/', $scheme); $path_full = (DIR_UPLOADS . (('' !== $path) ? ($path . '/') : '')); |
18 | 18 | |
19 | - if (!Explorer::isDir($path_full)) return; |
|
19 | + if (!Explorer::isDir($path_full)) { |
|
20 | + return; |
|
21 | + } |
|
20 | 22 | |
21 | 23 | $this->scheme = $scheme; $this->path = $path; $this->path_full = $path_full; |
22 | 24 | } |
@@ -27,9 +29,12 @@ discard block |
||
27 | 29 | |
28 | 30 | $scheme = []; $breadcrumbs = []; |
29 | 31 | |
30 | - if ([] !== $this->scheme) foreach ($this->scheme as $name) { |
|
32 | + if ([] !== $this->scheme) { |
|
33 | + foreach ($this->scheme as $name) { |
|
31 | 34 | |
32 | - $scheme[] = $name; $breadcrumbs[] = ['path' => implode('/', $scheme), 'name' => $name]; |
|
35 | + $scheme[] = $name; |
|
36 | + } |
|
37 | + $breadcrumbs[] = ['path' => implode('/', $scheme), 'name' => $name]; |
|
33 | 38 | } |
34 | 39 | |
35 | 40 | # ------------------------ |
@@ -12,7 +12,9 @@ discard block |
||
12 | 12 | |
13 | 13 | private function getPrototype(string $name) { |
14 | 14 | |
15 | - if (preg_match('/[\/\\\\]/', $name)) return false; |
|
15 | + if (preg_match('/[\/\\\\]/', $name)) { |
|
16 | + return false; |
|
17 | + } |
|
16 | 18 | |
17 | 19 | $path = (($this->parent->path() ? ($this->parent->path() . '/') : '') . $name); |
18 | 20 | |
@@ -34,11 +36,17 @@ discard block |
||
34 | 36 | |
35 | 37 | public function init(string $name) { |
36 | 38 | |
37 | - if (false === ($prototype = $this->getPrototype($name))) return false; |
|
39 | + if (false === ($prototype = $this->getPrototype($name))) { |
|
40 | + return false; |
|
41 | + } |
|
38 | 42 | |
39 | - if (!Explorer::{static::$checker}($prototype['path_full'])) return false; |
|
43 | + if (!Explorer::{static::$checker}($prototype['path_full'])) { |
|
44 | + return false; |
|
45 | + } |
|
40 | 46 | |
41 | - foreach ($prototype as $var => $value) $this->$var = $value; |
|
47 | + foreach ($prototype as $var => $value) { |
|
48 | + $this->$var = $value; |
|
49 | + } |
|
42 | 50 | |
43 | 51 | # ------------------------ |
44 | 52 | |
@@ -49,11 +57,17 @@ discard block |
||
49 | 57 | |
50 | 58 | public function create(string $name) { |
51 | 59 | |
52 | - if (('' !== $this->name) || (false === ($prototype = $this->getPrototype($name)))) return false; |
|
60 | + if (('' !== $this->name) || (false === ($prototype = $this->getPrototype($name)))) { |
|
61 | + return false; |
|
62 | + } |
|
53 | 63 | |
54 | - if (!Explorer::{static::$creator}($prototype['path_full'])) return false; |
|
64 | + if (!Explorer::{static::$creator}($prototype['path_full'])) { |
|
65 | + return false; |
|
66 | + } |
|
55 | 67 | |
56 | - foreach ($prototype as $var => $value) $this->$var = $value; |
|
68 | + foreach ($prototype as $var => $value) { |
|
69 | + $this->$var = $value; |
|
70 | + } |
|
57 | 71 | |
58 | 72 | # ------------------------ |
59 | 73 | |
@@ -64,11 +78,17 @@ discard block |
||
64 | 78 | |
65 | 79 | public function rename(string $name) { |
66 | 80 | |
67 | - if (('' === $this->name) || (false === ($prototype = $this->getPrototype($name)))) return false; |
|
81 | + if (('' === $this->name) || (false === ($prototype = $this->getPrototype($name)))) { |
|
82 | + return false; |
|
83 | + } |
|
68 | 84 | |
69 | - if (!@rename($this->path_full, $prototype['path_full'])) return false; |
|
85 | + if (!@rename($this->path_full, $prototype['path_full'])) { |
|
86 | + return false; |
|
87 | + } |
|
70 | 88 | |
71 | - foreach ($prototype as $var => $value) $this->$var = $value; |
|
89 | + foreach ($prototype as $var => $value) { |
|
90 | + $this->$var = $value; |
|
91 | + } |
|
72 | 92 | |
73 | 93 | # ------------------------ |
74 | 94 | |
@@ -79,9 +99,13 @@ discard block |
||
79 | 99 | |
80 | 100 | public function remove() { |
81 | 101 | |
82 | - if ('' === $this->name) return false; |
|
102 | + if ('' === $this->name) { |
|
103 | + return false; |
|
104 | + } |
|
83 | 105 | |
84 | - if (!Explorer::{static::$remover}($this->path_full, true)) return false; |
|
106 | + if (!Explorer::{static::$remover}($this->path_full, true)) { |
|
107 | + return false; |
|
108 | + } |
|
85 | 109 | |
86 | 110 | $this->name = ''; $this->path = ''; $this->path_full = ''; |
87 | 111 |
@@ -39,7 +39,9 @@ |
||
39 | 39 | |
40 | 40 | $modifier = ((0 === $this->menuitem->id) ? 'create' : 'edit'); |
41 | 41 | |
42 | - if (!$this->menuitem->$modifier($data)) return 'MENUITEM_ERROR_MODIFY'; |
|
42 | + if (!$this->menuitem->$modifier($data)) { |
|
43 | + return 'MENUITEM_ERROR_MODIFY'; |
|
44 | + } |
|
43 | 45 | |
44 | 46 | # ------------------------ |
45 | 47 |
@@ -23,7 +23,9 @@ |
||
23 | 23 | |
24 | 24 | # Set defaults |
25 | 25 | |
26 | -if (function_exists('mb_internal_encoding')) mb_internal_encoding('UTF-8'); |
|
26 | +if (function_exists('mb_internal_encoding')) { |
|
27 | + mb_internal_encoding('UTF-8'); |
|
28 | +} |
|
27 | 29 | |
28 | 30 | date_default_timezone_set('UTC'); |
29 | 31 |
@@ -31,7 +31,9 @@ |
||
31 | 31 | |
32 | 32 | public static function delete(string $name) { |
33 | 33 | |
34 | - if (isset($_COOKIE[$name])) unset($_COOKIE[$name]); |
|
34 | + if (isset($_COOKIE[$name])) { |
|
35 | + unset($_COOKIE[$name]); |
|
36 | + } |
|
35 | 37 | } |
36 | 38 | } |
37 | 39 | } |
@@ -26,7 +26,9 @@ |
||
26 | 26 | |
27 | 27 | public function __construct(string $message = '') { |
28 | 28 | |
29 | - if ('' !== $message) $this->message = $message; |
|
29 | + if ('' !== $message) { |
|
30 | + $this->message = $message; |
|
31 | + } |
|
30 | 32 | } |
31 | 33 | } |
32 | 34 |
@@ -2,7 +2,9 @@ discard block |
||
2 | 2 | |
3 | 3 | # Check PHP version |
4 | 4 | |
5 | -if (version_compare(PHP_VERSION, '7.0.0') < 0) exit('PHP version 7 or higher is required.'); |
|
5 | +if (version_compare(PHP_VERSION, '7.0.0') < 0) { |
|
6 | + exit('PHP version 7 or higher is required.'); |
|
7 | +} |
|
6 | 8 | |
7 | 9 | # Set error reporting |
8 | 10 | |
@@ -37,9 +39,11 @@ discard block |
||
37 | 39 | |
38 | 40 | # Require class file |
39 | 41 | |
40 | - if (@file_exists($file_name = ($path . '.php')) && @is_file($file_name)) require_once $file_name; |
|
41 | - |
|
42 | - else if (@file_exists($file_name = ($path . '/' . $last . '.php')) && @is_file($file_name)) require_once $file_name; |
|
42 | + if (@file_exists($file_name = ($path . '.php')) && @is_file($file_name)) { |
|
43 | + require_once $file_name; |
|
44 | + } else if (@file_exists($file_name = ($path . '/' . $last . '.php')) && @is_file($file_name)) { |
|
45 | + require_once $file_name; |
|
46 | + } |
|
43 | 47 | |
44 | 48 | # Check if class exists |
45 | 49 | |
@@ -50,5 +54,7 @@ discard block |
||
50 | 54 | |
51 | 55 | # Call autoload method |
52 | 56 | |
53 | - if (method_exists($class_name, '__autoload')) $class_name::__autoload(); |
|
54 | -}); |
|
57 | + if (method_exists($class_name, '__autoload')) { |
|
58 | + $class_name::__autoload(); |
|
59 | + } |
|
60 | + }); |
@@ -49,9 +49,13 @@ |
||
49 | 49 | |
50 | 50 | public static function url(string $value) { |
51 | 51 | |
52 | - if (false === ($value = parent::url($value))) return false; |
|
52 | + if (false === ($value = parent::url($value))) { |
|
53 | + return false; |
|
54 | + } |
|
53 | 55 | |
54 | - if (!preg_match('/^https?:\/\//', $value)) return false; |
|
56 | + if (!preg_match('/^https?:\/\//', $value)) { |
|
57 | + return false; |
|
58 | + } |
|
55 | 59 | |
56 | 60 | # ------------------------ |
57 | 61 |
@@ -19,11 +19,15 @@ |
||
19 | 19 | |
20 | 20 | private function add(string $type, string $name, array $args) { |
21 | 21 | |
22 | - if (('' === $name) || isset($this->list[$name])) return; |
|
22 | + if (('' === $name) || isset($this->list[$name])) { |
|
23 | + return; |
|
24 | + } |
|
23 | 25 | |
24 | 26 | $this->list[$name] = new $this->types[$type](...$args); |
25 | 27 | |
26 | - if (($type !== 'textual') || $this->list[$name]->short) $this->secure[] = $name; |
|
28 | + if (($type !== 'textual') || $this->list[$name]->short) { |
|
29 | + $this->secure[] = $name; |
|
30 | + } |
|
27 | 31 | } |
28 | 32 | |
29 | 33 | # Constructor |