@@ -105,7 +105,8 @@ |
||
105 | 105 | $moduleClassName = $this->findModuleClass($className); |
106 | 106 | if (!is_bool($moduleClassName) && $moduleClassName != $className) { |
107 | 107 | return $this->_objects[$moduleClassName][$paramsStr] = $this->_objects[$className][$paramsStr] = $this->getObject($moduleClassName); |
108 | - } elseif (Module::installed($className, $this) && class_exists($className)) { |
|
108 | + } |
|
109 | + elseif (Module::installed($className, $this) && class_exists($className)) { |
|
109 | 110 | $this->_objects[$className][$paramsStr] = new $className($this); |
110 | 111 | } |
111 | 112 | if (isset($this->_objects[$className][$paramsStr])) { |
@@ -49,7 +49,8 @@ discard block |
||
49 | 49 | case 'method': |
50 | 50 | if (!empty($colInfo['colParams']['params'])) { |
51 | 51 | $values = call_user_func_array([App::$cur->$colInfo['colParams']['module'], $colInfo['colParams']['method']], $colInfo['colParams']['params']); |
52 | - } else { |
|
52 | + } |
|
53 | + else { |
|
53 | 54 | $values = $colInfo['colParams']['module']->$colInfo['colParams']['method'](); |
54 | 55 | } |
55 | 56 | return !empty($values[$this->model->{$this->valueKey}]) ? $values[$this->model->{$this->valueKey}] : 'Не задано'; |
@@ -63,7 +64,8 @@ discard block |
||
63 | 64 | $file = Files\File::get($this->model->{$this->valueKey}); |
64 | 65 | if ($file) { |
65 | 66 | return '<img src="' . $file->path . '?resize=60x120" />'; |
66 | - } else { |
|
67 | + } |
|
68 | + else { |
|
67 | 69 | return '<img src="/static/system/images/no-image.png?resize=60x120" />'; |
68 | 70 | } |
69 | 71 | case 'bool': |
@@ -26,7 +26,8 @@ discard block |
||
26 | 26 | $html .=" {$key} = '"; |
27 | 27 | if (!is_array($value)) { |
28 | 28 | $html .= addcslashes($value, "'"); |
29 | - } else { |
|
29 | + } |
|
30 | + else { |
|
30 | 31 | $html .= json_encode($value); |
31 | 32 | } |
32 | 33 | $html .= "'"; |
@@ -34,9 +35,11 @@ discard block |
||
34 | 35 | } |
35 | 36 | if ($noCloseTag === null) { |
36 | 37 | $html .= ' />'; |
37 | - } elseif ($noCloseTag === false) { |
|
38 | + } |
|
39 | + elseif ($noCloseTag === false) { |
|
38 | 40 | $html .= ">{$body}</{$tag}>"; |
39 | - } else { |
|
41 | + } |
|
42 | + else { |
|
40 | 43 | $html .= ">{$body}"; |
41 | 44 | } |
42 | 45 | return $html; |
@@ -45,8 +45,9 @@ discard block |
||
45 | 45 | return self::$_configs['custom'][$path]; |
46 | 46 | } |
47 | 47 | |
48 | - if (!file_exists($path)) |
|
49 | - return []; |
|
48 | + if (!file_exists($path)) { |
|
49 | + return []; |
|
50 | + } |
|
50 | 51 | |
51 | 52 | return self::$_configs['custom'][$path] = include $path; |
52 | 53 | } |
@@ -85,7 +86,8 @@ discard block |
||
85 | 86 | return self::$_configs['shareModules'][$module]; |
86 | 87 | } |
87 | 88 | $path = INJI_PROGRAM_DIR . "/config/modules/{$module}.php"; |
88 | - } else { |
|
89 | + } |
|
90 | + else { |
|
89 | 91 | if (isset(self::$_configs['share'])) { |
90 | 92 | return self::$_configs['share']; |
91 | 93 | } |
@@ -94,14 +96,16 @@ discard block |
||
94 | 96 | if (!file_exists($path)) { |
95 | 97 | if (file_exists(INJI_SYSTEM_DIR . "/modules/{$module}/defaultConfig.php")) { |
96 | 98 | $path = INJI_SYSTEM_DIR . "/modules/{$module}/defaultConfig.php"; |
97 | - } else { |
|
99 | + } |
|
100 | + else { |
|
98 | 101 | return []; |
99 | 102 | } |
100 | 103 | } |
101 | 104 | |
102 | 105 | if ($module) { |
103 | 106 | return self::$_configs['shareModules'][$module] = include $path; |
104 | - } else { |
|
107 | + } |
|
108 | + else { |
|
105 | 109 | return self::$_configs['share'] = include $path; |
106 | 110 | } |
107 | 111 | } |
@@ -122,7 +126,8 @@ discard block |
||
122 | 126 | if ($system) { |
123 | 127 | $appName = 'system'; |
124 | 128 | $appPath = INJI_SYSTEM_DIR; |
125 | - } else { |
|
129 | + } |
|
130 | + else { |
|
126 | 131 | $appName = $app->name; |
127 | 132 | $appPath = $app->path; |
128 | 133 | } |
@@ -176,7 +181,8 @@ discard block |
||
176 | 181 | $path = INJI_PROGRAM_DIR . "/config/modules/{$module}.php"; |
177 | 182 | self::$_configs['shareModules'][$module] = $data; |
178 | 183 | Inji::$inst->event('Config-change-shareModules-' . $module, $data); |
179 | - } else { |
|
184 | + } |
|
185 | + else { |
|
180 | 186 | $path = INJI_PROGRAM_DIR . "/config/config.php"; |
181 | 187 | self::$_configs['share'] = $data; |
182 | 188 | Inji::$inst->event('Config-change-share', $data); |
@@ -246,7 +246,8 @@ discard block |
||
246 | 246 | if (strpos($pathName, 'slice')) { |
247 | 247 | $controllerName = ucfirst($this->params[0]); |
248 | 248 | $params = array_slice($this->params, 1); |
249 | - } else { |
|
249 | + } |
|
250 | + else { |
|
250 | 251 | $controllerName = $this->moduleName; |
251 | 252 | $params = $this->params; |
252 | 253 | } |
@@ -270,7 +271,8 @@ discard block |
||
270 | 271 | public static function getInfo($moduleName = '') { |
271 | 272 | if (!$moduleName && get_called_class()) { |
272 | 273 | $moduleName = get_called_class(); |
273 | - } elseif (!$moduleName) { |
|
274 | + } |
|
275 | + elseif (!$moduleName) { |
|
274 | 276 | return []; |
275 | 277 | } |
276 | 278 | $paths = Module::getModulePaths($moduleName); |
@@ -303,7 +305,8 @@ discard block |
||
303 | 305 | foreach ($snippetsPaths as $snippetPath) { |
304 | 306 | if (is_dir($path . $dir . '/' . $snippetsPath . '/' . $snippetPath)) { |
305 | 307 | $snippets[$snippetPath] = include $path . $dir . '/' . $snippetsPath . '/' . $snippetPath . '/info.php'; |
306 | - } else { |
|
308 | + } |
|
309 | + else { |
|
307 | 310 | $snippets[pathinfo($snippetPath, PATHINFO_FILENAME)] = include $path . $dir . '/' . $snippetsPath . '/' . $snippetPath; |
308 | 311 | } |
309 | 312 | } |
@@ -81,7 +81,7 @@ |
||
81 | 81 | return true; |
82 | 82 | } |
83 | 83 | } |
84 | - return FALSE; |
|
84 | + return false; |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
@@ -51,7 +51,8 @@ discard block |
||
51 | 51 | $config = Config::custom(App::$primary->path . '/config/events.php'); |
52 | 52 | $config[$eventName][$listenCode] = serialize($callback); |
53 | 53 | Config::save(App::$primary->path . '/config/events.php', $config); |
54 | - } else { |
|
54 | + } |
|
55 | + else { |
|
55 | 56 | $this->_listeners[$eventName][$listenCode] = $callback; |
56 | 57 | } |
57 | 58 | } |
@@ -87,9 +88,11 @@ discard block |
||
87 | 88 | $event['calledBefore'] = $calledBefore; |
88 | 89 | if (is_callable($callback)) { |
89 | 90 | $event['eventObject'] = $callback($event); |
90 | - } elseif (is_array($callback) && isset($callback['callback'])) { |
|
91 | + } |
|
92 | + elseif (is_array($callback) && isset($callback['callback'])) { |
|
91 | 93 | $event['eventObject'] = $callback($event, $callback); |
92 | - } else { |
|
94 | + } |
|
95 | + else { |
|
93 | 96 | $event['eventObject'] = App::$cur->{$callback['module']}->{$callback['method']}($event, $callback); |
94 | 97 | } |
95 | 98 | $calledBefore[$iteration] = $listenCode; |
@@ -15,7 +15,7 @@ |
||
15 | 15 | * |
16 | 16 | * @var Inji |
17 | 17 | */ |
18 | - public static $inst = NULL; |
|
18 | + public static $inst = null; |
|
19 | 19 | |
20 | 20 | /** |
21 | 21 | * Dynamic events listeners |
@@ -66,7 +66,8 @@ |
||
66 | 66 | if (!empty($this->params[0]) && method_exists($this, $this->params[0] . 'Action')) { |
67 | 67 | $this->method = $this->params[0]; |
68 | 68 | $this->params = array_slice($this->params, 1); |
69 | - } elseif (!method_exists($this, $this->method . 'Action')) { |
|
69 | + } |
|
70 | + elseif (!method_exists($this, $this->method . 'Action')) { |
|
70 | 71 | INJI_SYSTEM_ERROR('method not found', true); |
71 | 72 | } |
72 | 73 | if (!$this->checkAccess()) { |
@@ -27,7 +27,8 @@ discard block |
||
27 | 27 | } |
28 | 28 | } |
29 | 29 | return $result; |
30 | - } else { |
|
30 | + } |
|
31 | + else { |
|
31 | 32 | return Router::loadClass($className); |
32 | 33 | } |
33 | 34 | } |
@@ -99,7 +100,8 @@ discard block |
||
99 | 100 | $paths[$code . '_ObjectDir'] = $folder . '/objects/' . $classPath . '/' . $classPath . '.php'; |
100 | 101 | $paths[$code . '_Model'] = $folder . '/models/' . $classPath . '.php'; |
101 | 102 | $paths[$code . '_ModelDir'] = $folder . '/models/' . $classPath . '/' . $classPath . '.php'; |
102 | - } else { |
|
103 | + } |
|
104 | + else { |
|
103 | 105 | $classFile = substr($classPath, strrpos($classPath, '/') + 1); |
104 | 106 | $classPathWithotClass = substr($classPath, 0, strrpos($classPath, '/')); |
105 | 107 |
@@ -81,7 +81,7 @@ |
||
81 | 81 | return true; |
82 | 82 | } |
83 | 83 | } |
84 | - return FALSE; |
|
84 | + return false; |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
@@ -24,7 +24,8 @@ |
||
24 | 24 | $code .= '$' . $this->name . ' = '; |
25 | 25 | if (is_array($this->value)) { |
26 | 26 | $code .= \CodeGenerator::genArray($this->value); |
27 | - } else { |
|
27 | + } |
|
28 | + else { |
|
28 | 29 | $code .= '"' . str_replace('"', '\"', $this->value) . '";'; |
29 | 30 | } |
30 | 31 | return $code; |