@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | $this->setJsonHeader(); |
| 33 | 33 | $configs = AppRecord::getConfigs('widget', 'Comments'); |
| 34 | 34 | |
| 35 | - $replayTo = (int)$this->request->request->get('replay-to'); |
|
| 35 | + $replayTo = (int) $this->request->request->get('replay-to'); |
|
| 36 | 36 | $model = null; |
| 37 | 37 | // check if its a answer (comment answer type) |
| 38 | 38 | if ($replayTo > 0) { |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | // pass general comment params to model |
| 47 | - $model->message = App::$Security->secureHtml((string)$this->request->request->get('message')); |
|
| 47 | + $model->message = App::$Security->secureHtml((string) $this->request->request->get('message')); |
|
| 48 | 48 | $model->guestName = App::$Security->strip_tags($this->request->request->get('guest-name')); |
| 49 | 49 | |
| 50 | 50 | // check model conditions before add new row |
@@ -76,12 +76,12 @@ discard block |
||
| 76 | 76 | // get configs |
| 77 | 77 | $configs = AppRecord::getConfigs('widget', 'Comments'); |
| 78 | 78 | // items per page |
| 79 | - $perPage = (int)$configs['perPage']; |
|
| 79 | + $perPage = (int) $configs['perPage']; |
|
| 80 | 80 | // offset can be only integer |
| 81 | - $index = (int)$index; |
|
| 81 | + $index = (int) $index; |
|
| 82 | 82 | $offset = $perPage * $index; |
| 83 | 83 | // get comment target path and check |
| 84 | - $path = (string)$this->request->query->get('path'); |
|
| 84 | + $path = (string) $this->request->query->get('path'); |
|
| 85 | 85 | if (Str::likeEmpty($path)) { |
| 86 | 86 | throw new NotFoundException('Wrong path'); |
| 87 | 87 | } |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | ->where('moderate', '=', 0); |
| 92 | 92 | |
| 93 | 93 | // check if comments is depend of language locale |
| 94 | - if ((int)$configs['onlyLocale'] === 1) { |
|
| 94 | + if ((int) $configs['onlyLocale'] === 1) { |
|
| 95 | 95 | $query = $query->where('lang', '=', $this->request->getLanguage()); |
| 96 | 96 | } |
| 97 | 97 | |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | { |
| 142 | 142 | $this->setJsonHeader(); |
| 143 | 143 | // check input data |
| 144 | - if (!Obj::isLikeInt($commentId) || (int)$commentId < 1) { |
|
| 144 | + if (!Obj::isLikeInt($commentId) || (int) $commentId < 1) { |
|
| 145 | 145 | throw new ForbiddenException('Input data is incorrect'); |
| 146 | 146 | } |
| 147 | 147 | |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | // get data from db by comment id |
| 152 | 152 | $records = CommentAnswer::where('comment_id', '=', $commentId) |
| 153 | 153 | ->where('moderate', '=', 0); |
| 154 | - if ((int)$configs['onlyLocale'] === 1) { |
|
| 154 | + if ((int) $configs['onlyLocale'] === 1) { |
|
| 155 | 155 | $records = $records->where('lang', '=', $this->request->getLanguage()); |
| 156 | 156 | } |
| 157 | 157 | |
@@ -195,11 +195,11 @@ discard block |
||
| 195 | 195 | foreach ($path as $id => $uri) { |
| 196 | 196 | $query = CommentPost::where('pathway', '=', $uri)->where('moderate', '=', 0); |
| 197 | 197 | // check if comments is depend of language locale |
| 198 | - if ((int)$configs['onlyLocale'] === 1) { |
|
| 198 | + if ((int) $configs['onlyLocale'] === 1) { |
|
| 199 | 199 | $query = $query->where('lang', '=', $this->request->getLanguage()); |
| 200 | 200 | } |
| 201 | 201 | // set itemId => count |
| 202 | - $count[(int)$id] = $query->count(); |
|
| 202 | + $count[(int) $id] = $query->count(); |
|
| 203 | 203 | } |
| 204 | 204 | // render json response |
| 205 | 205 | return json_encode(['status' => 1, 'count' => $count]); |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | public function actionIndex() |
| 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 | // get feedback posts AR table |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | // initialize model with answer add if thread is not closed |
| 77 | 77 | $model = null; |
| 78 | - if ((int)$record->closed !== 1) { |
|
| 78 | + if ((int) $record->closed !== 1) { |
|
| 79 | 79 | $model = new FormAnswerAdd($record, App::$User->identity()->getId()); |
| 80 | 80 | if ($model->send()) { |
| 81 | 81 | if ($model->validate()) { |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | case 'answer': |
| 116 | 116 | $record = FeedbackAnswer::find($id); |
| 117 | 117 | if ($record !== null && $record !== false) { |
| 118 | - $postId = (int)$record->getFeedbackPost()->id; |
|
| 118 | + $postId = (int) $record->getFeedbackPost()->id; |
|
| 119 | 119 | } |
| 120 | 120 | break; |
| 121 | 121 | } |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | if ($model->validate()) { |
| 132 | 132 | $model->make(); |
| 133 | 133 | App::$Session->getFlashBag()->add('success', __('Feedback item are successful changed')); |
| 134 | - $this->response->redirect('feedback/read/' . $postId); |
|
| 134 | + $this->response->redirect('feedback/read/'.$postId); |
|
| 135 | 135 | } else { |
| 136 | 136 | App::$Session->getFlashBag()->add('danger', __('Updating is failed')); |
| 137 | 137 | } |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | App::$Session->getFlashBag()->add('success', __('Feedback request is changed!')); |
| 182 | 182 | |
| 183 | 183 | // redirect to feedback post read |
| 184 | - $this->response->redirect('feedback/read/' . $id); |
|
| 184 | + $this->response->redirect('feedback/read/'.$id); |
|
| 185 | 185 | return null; |
| 186 | 186 | } |
| 187 | 187 | |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | // its a answer, lets remove it and redirect back in post |
| 227 | 227 | $postId = $record->feedback_id; |
| 228 | 228 | $record->delete(); |
| 229 | - $this->response->redirect('feedback/read/' . $postId); |
|
| 229 | + $this->response->redirect('feedback/read/'.$postId); |
|
| 230 | 230 | } |
| 231 | 231 | } |
| 232 | 232 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | $query = new UserRecords(); |
| 41 | 41 | |
| 42 | 42 | // set current page and offset |
| 43 | - $page = (int)$this->request->query->get('page', 0); |
|
| 43 | + $page = (int) $this->request->query->get('page', 0); |
|
| 44 | 44 | $offset = $page * self::ITEM_PER_PAGE; |
| 45 | 45 | |
| 46 | 46 | // build pagination |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | public function actionDelete($id = null) |
| 105 | 105 | { |
| 106 | 106 | // check if id is passed or get data from GET as array ids |
| 107 | - if ($id === 0 || (int)$id < 1) { |
|
| 107 | + if ($id === 0 || (int) $id < 1) { |
|
| 108 | 108 | $ids = $this->request->query->get('selected'); |
| 109 | 109 | if (Obj::isArray($ids) && Arr::onlyNumericValues($ids)) { |
| 110 | 110 | $id = $ids; |
@@ -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 | /** |
@@ -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 | } |