@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $query = new ProfileRecords(); |
34 | 34 | |
35 | 35 | // set current page and offset |
36 | - $page = (int)$this->request->query->get('page'); |
|
36 | + $page = (int) $this->request->query->get('page'); |
|
37 | 37 | $offset = $page * self::ITEM_PER_PAGE; |
38 | 38 | |
39 | 39 | // build pagination |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | */ |
61 | 61 | public function actionDelete($id) |
62 | 62 | { |
63 | - $this->response->redirect('user/delete/' . $id); |
|
63 | + $this->response->redirect('user/delete/'.$id); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
@@ -37,21 +37,21 @@ discard block |
||
37 | 37 | // cache some data |
38 | 38 | $rootSize = App::$Cache->get('root.size'); |
39 | 39 | if ($rootSize === null) { |
40 | - $rootSize = round(Directory::getSize('/') / (1024*1000), 2) . ' mb'; |
|
40 | + $rootSize = round(Directory::getSize('/') / (1024 * 1000), 2).' mb'; |
|
41 | 41 | App::$Cache->set('root.size', $rootSize, 86400); // 24 hours caching = 60 * 60 * 24 |
42 | 42 | } |
43 | 43 | $loadAvg = App::$Cache->get('load.average'); |
44 | 44 | if ($loadAvg === null) { |
45 | 45 | $loadAvg = Environment::loadAverage(); |
46 | - App::$Cache->set('load.average', $loadAvg, 60*5); // 5 min cache |
|
46 | + App::$Cache->set('load.average', $loadAvg, 60 * 5); // 5 min cache |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | // prepare system statistic |
50 | 50 | $stats = [ |
51 | - 'ff_version' => App::$Properties->version['num'] . ' (' . App::$Properties->version['date'] . ')', |
|
52 | - 'php_version' => Environment::phpVersion() . ' (' . Environment::phpSAPI() . ')', |
|
51 | + 'ff_version' => App::$Properties->version['num'].' ('.App::$Properties->version['date'].')', |
|
52 | + 'php_version' => Environment::phpVersion().' ('.Environment::phpSAPI().')', |
|
53 | 53 | 'os_name' => Environment::osName(), |
54 | - 'database_name' => App::$Database->connection()->getDatabaseName() . ' (' . App::$Database->connection()->getDriverName() . ')', |
|
54 | + 'database_name' => App::$Database->connection()->getDatabaseName().' ('.App::$Database->connection()->getDriverName().')', |
|
55 | 55 | 'file_size' => $rootSize, |
56 | 56 | 'load_avg' => $loadAvg |
57 | 57 | ]; |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | public function actionFiles() |
104 | 104 | { |
105 | 105 | return $this->view->render('files', [ |
106 | - 'connector' => App::$Alias->scriptUrl . '/api/main/files?lang=' . $this->request->getLanguage() |
|
106 | + 'connector' => App::$Alias->scriptUrl.'/api/main/files?lang='.$this->request->getLanguage() |
|
107 | 107 | ]); |
108 | 108 | } |
109 | 109 | |
@@ -174,9 +174,9 @@ discard block |
||
174 | 174 | */ |
175 | 175 | public function actionDeleteroute() |
176 | 176 | { |
177 | - $type = (string)$this->request->query->get('type'); |
|
178 | - $loader = (string)$this->request->query->get('loader'); |
|
179 | - $source = Str::lowerCase((string)$this->request->query->get('path')); |
|
177 | + $type = (string) $this->request->query->get('type'); |
|
178 | + $loader = (string) $this->request->query->get('loader'); |
|
179 | + $source = Str::lowerCase((string) $this->request->query->get('path')); |
|
180 | 180 | |
181 | 181 | $model = new EntityDeleteRoute($type, $loader, $source); |
182 | 182 | if ($model->send() && $model->validate()) { |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | { |
200 | 200 | $stats = App::$Cache->stats(); |
201 | 201 | // get size in mb from cache stats |
202 | - $size = round((int)$stats['size'] / (1024*1024), 2); |
|
202 | + $size = round((int) $stats['size'] / (1024 * 1024), 2); |
|
203 | 203 | |
204 | 204 | // check if submited |
205 | 205 | if ($this->request->request->get('clearcache', false)) { |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | public function actionIndex() |
41 | 41 | { |
42 | 42 | // set current page and offset |
43 | - $page = (int)$this->request->query->get('page'); |
|
43 | + $page = (int) $this->request->query->get('page'); |
|
44 | 44 | $offset = $page * self::ITEM_PER_PAGE; |
45 | 45 | |
46 | 46 | // initialize active record model |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | public function actionDelete($type, $id = 0) |
141 | 141 | { |
142 | 142 | // sounds like a multiply delete definition |
143 | - if ($id === 0 || (int)$id < 1) { |
|
143 | + if ($id === 0 || (int) $id < 1) { |
|
144 | 144 | $ids = $this->request->query->get('selected'); |
145 | 145 | if (Obj::isArray($ids) && Arr::onlyNumericValues($ids)) { |
146 | 146 | $id = $ids; |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | if ($model->send() && $model->validate()) { |
175 | 175 | $model->make(); |
176 | 176 | App::$Session->getFlashBag()->add('success', __('Comments or answers are successful deleted!')); |
177 | - $this->response->redirect('comments/' . ($type === 'answer' ? 'answerlist' : 'index')); |
|
177 | + $this->response->redirect('comments/'.($type === 'answer' ? 'answerlist' : 'index')); |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | // render view |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | public function actionPublish($type, $id = 0) |
196 | 196 | { |
197 | 197 | // check if it multiple accept ids |
198 | - if ($id === 0 || (int)$id < 1) { |
|
198 | + if ($id === 0 || (int) $id < 1) { |
|
199 | 199 | $ids = $this->request->query->get('selected'); |
200 | 200 | if (Obj::isArray($ids) && Arr::onlyNumericValues($ids)) { |
201 | 201 | $id = $ids; |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | if ($model->send()) { |
230 | 230 | $model->make(); |
231 | 231 | App::$Session->getFlashBag()->add('success', __('Comments or answers are successful published')); |
232 | - $this->response->redirect('comments/' . ($type === 'answer' ? 'answerlist' : 'index')); |
|
232 | + $this->response->redirect('comments/'.($type === 'answer' ? 'answerlist' : 'index')); |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | return $this->view->render('publish', [ |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | public function actionAnswerlist() |
247 | 247 | { |
248 | 248 | // set current page and offset |
249 | - $page = (int)$this->request->query->get('page'); |
|
249 | + $page = (int) $this->request->query->get('page'); |
|
250 | 250 | $offset = $page * self::ITEM_PER_PAGE; |
251 | 251 | |
252 | 252 | // initialize ar answers model |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | /** set default locale */ |
15 | 15 | $_GET['lang'] = 'en'; |
16 | 16 | |
17 | -require_once(root . '/Loader/Autoload.php'); |
|
17 | +require_once(root.'/Loader/Autoload.php'); |
|
18 | 18 | |
19 | 19 | // make fast-access alias \App::$Object |
20 | 20 | // class_alias('Ffcms\Core\App', 'App'); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $logs = $cronManager->run(); |
43 | 43 | if (PHP_SAPI === 'cli') { |
44 | 44 | if ($logs !== null && \Ffcms\Core\Helper\Type\Obj::isArray($logs) && count($logs) > 0) { |
45 | - echo 'Run cron tasks: ' . PHP_EOL . implode(PHP_EOL, $logs); |
|
45 | + echo 'Run cron tasks: '.PHP_EOL.implode(PHP_EOL, $logs); |
|
46 | 46 | } else { |
47 | 47 | echo 'No tasks runned'; |
48 | 48 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | } |
32 | 32 | |
33 | 33 | // add localizations |
34 | - App::$Translate->append(App::$Alias->currentViewPath . '/I18n/' . App::$Request->getLanguage() . '.php'); |
|
34 | + App::$Translate->append(App::$Alias->currentViewPath.'/I18n/'.App::$Request->getLanguage().'.php'); |
|
35 | 35 | |
36 | 36 | parent::__construct(); |
37 | 37 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | // check if disabled (0 = enabled, anything else = on) |
57 | - return (int)$this->application->disabled === 0; |
|
57 | + return (int) $this->application->disabled === 0; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -66,10 +66,10 @@ discard block |
||
66 | 66 | if ($this->configs !== null) { |
67 | 67 | return $this->configs; |
68 | 68 | } |
69 | - $configs = (array)unserialize($this->application->configs); // data always stored like a "string" objects |
|
69 | + $configs = (array) unserialize($this->application->configs); // data always stored like a "string" objects |
|
70 | 70 | foreach ($configs as $cfg => $value) { |
71 | 71 | if (Obj::isLikeInt($value)) { |
72 | - $configs[$cfg] = (int)$value; // convert string 1 "1" to int 1 1 |
|
72 | + $configs[$cfg] = (int) $value; // convert string 1 "1" to int 1 1 |
|
73 | 73 | } |
74 | 74 | } |
75 | 75 | $this->configs = $configs; |
@@ -51,7 +51,7 @@ |
||
51 | 51 | } |
52 | 52 | |
53 | 53 | // if widget is disabled - lets return nothing |
54 | - return !(bool)$wData->disabled; |
|
54 | + return !(bool) $wData->disabled; |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | } |
58 | 58 | \ No newline at end of file |