@@ -47,9 +47,9 @@ discard block |
||
| 47 | 47 | $records = null; |
| 48 | 48 | |
| 49 | 49 | // set current page and offset |
| 50 | - $page = (int)App::$Request->query->get('page'); |
|
| 50 | + $page = (int) App::$Request->query->get('page'); |
|
| 51 | 51 | $cfgs = Serialize::decode($this->application->configs); |
| 52 | - $userPerPage = (int)$cfgs['usersOnPage']; |
|
| 52 | + $userPerPage = (int) $cfgs['usersOnPage']; |
|
| 53 | 53 | if ($userPerPage < 1) { |
| 54 | 54 | $userPerPage = 1; |
| 55 | 55 | } |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | switch ($filter_name) { |
| 59 | 59 | case 'rating': // rating list, order by rating DESC |
| 60 | 60 | // check if rating is enabled |
| 61 | - if ((int)$cfgs['rating'] !== 1) { |
|
| 61 | + if ((int) $cfgs['rating'] !== 1) { |
|
| 62 | 62 | throw new NotFoundException(); |
| 63 | 63 | } |
| 64 | 64 | $records = (new ProfileRecords())->orderBy('rating', 'DESC'); |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | if (Str::likeEmpty($filter_value)) { |
| 68 | 68 | throw new NotFoundException(); |
| 69 | 69 | } |
| 70 | - $records = (new ProfileRecords())->where('hobby', 'like', '%' . $filter_value . '%'); |
|
| 70 | + $records = (new ProfileRecords())->where('hobby', 'like', '%'.$filter_value.'%'); |
|
| 71 | 71 | break; |
| 72 | 72 | case 'city': |
| 73 | 73 | if (Str::likeEmpty($filter_value)) { |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | if ($filter_value === null || !Obj::isLikeInt($filter_value)) { |
| 80 | 80 | throw new NotFoundException(); |
| 81 | 81 | } |
| 82 | - $records = (new ProfileRecords())->where('birthday', 'like', $filter_value . '-%'); |
|
| 82 | + $records = (new ProfileRecords())->where('birthday', 'like', $filter_value.'-%'); |
|
| 83 | 83 | break; |
| 84 | 84 | case 'all': |
| 85 | 85 | $records = (new ProfileRecords())->orderBy('id', 'DESC'); |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | 'pagination' => $pagination, |
| 103 | 103 | 'id' => $filter_name, |
| 104 | 104 | 'add' => $filter_value, |
| 105 | - 'ratingOn' => (int)$cfgs['rating'] |
|
| 105 | + 'ratingOn' => (int) $cfgs['rating'] |
|
| 106 | 106 | ]); |
| 107 | 107 | } |
| 108 | 108 | |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | public function actionShow($userId) |
| 119 | 119 | { |
| 120 | 120 | $cfg = Serialize::decode($this->application->configs); |
| 121 | - if ((int)$cfg['guestView'] !== 1 && !App::$User->isAuth()) { |
|
| 121 | + if ((int) $cfg['guestView'] !== 1 && !App::$User->isAuth()) { |
|
| 122 | 122 | throw new ForbiddenException(__('You must login to view other profile')); |
| 123 | 123 | } |
| 124 | 124 | // check if target exists |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | App::$Session->getFlashBag()->add('error', __('This user are in your black list or you are in blacklist!')); |
| 141 | 141 | } else { |
| 142 | 142 | // check if message added |
| 143 | - if ($wallModel->makePost($targetPersone, $viewerPersone, (int)$cfg['delayBetweenPost'])) { |
|
| 143 | + if ($wallModel->makePost($targetPersone, $viewerPersone, (int) $cfg['delayBetweenPost'])) { |
|
| 144 | 144 | App::$Session->getFlashBag()->add('success', __('The message was successful posted!')); |
| 145 | 145 | } else { |
| 146 | 146 | App::$Session->getFlashBag()->add('warning', __('Posting message was failed! You need to wait some time...')); |
@@ -151,8 +151,8 @@ discard block |
||
| 151 | 151 | |
| 152 | 152 | $query = $targetPersone->getWall(); // relation hasMany from users to walls |
| 153 | 153 | // pagination and query params |
| 154 | - $wallPage = (int)App::$Request->query->get('page'); |
|
| 155 | - $wallItems = (int)$cfg['wallPostOnPage']; |
|
| 154 | + $wallPage = (int) App::$Request->query->get('page'); |
|
| 155 | + $wallItems = (int) $cfg['wallPostOnPage']; |
|
| 156 | 156 | $wallOffset = $wallPage * $wallItems; |
| 157 | 157 | |
| 158 | 158 | // build pagination |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | 'notify' => App::$Session->getFlashBag()->all(), |
| 175 | 175 | 'wallRecords' => $wallRecords, |
| 176 | 176 | 'pagination' => $wallPagination, |
| 177 | - 'ratingOn' => (int)$cfg['rating'] === 1 |
|
| 177 | + 'ratingOn' => (int) $cfg['rating'] === 1 |
|
| 178 | 178 | ]); |
| 179 | 179 | } |
| 180 | 180 | |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | $wallModel = new FormWallPostDelete($wallPost); |
| 247 | 247 | if ($wallModel->send() && $wallModel->validate()) { |
| 248 | 248 | $wallModel->make(); |
| 249 | - App::$Response->redirect('profile/show/' . $wallPost->target_id); |
|
| 249 | + App::$Response->redirect('profile/show/'.$wallPost->target_id); |
|
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | return App::$View->render('wall_delete', [ |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | |
| 352 | 352 | // set user id from ?id= get param if form not sended |
| 353 | 353 | if (!$model->send()) { |
| 354 | - $uid = (int)App::$Request->query->get('id'); |
|
| 354 | + $uid = (int) App::$Request->query->get('id'); |
|
| 355 | 355 | if ($uid > 0) { |
| 356 | 356 | $model->id = $uid; |
| 357 | 357 | } |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | // get blocked users |
| 370 | 370 | $records = Blacklist::where('user_id', '=', $user->getId()); |
| 371 | 371 | |
| 372 | - $page = (int)App::$Request->query->get('page'); |
|
| 372 | + $page = (int) App::$Request->query->get('page'); |
|
| 373 | 373 | $offset = $page * self::BLOCK_PER_PAGE; |
| 374 | 374 | |
| 375 | 375 | // build pagination |
@@ -474,9 +474,9 @@ discard block |
||
| 474 | 474 | // check if request is sended |
| 475 | 475 | if ($model->send() && $model->validate()) { |
| 476 | 476 | // get records from db |
| 477 | - $records = ProfileRecords::where('nick', 'like', '%' . $model->query . '%'); |
|
| 478 | - $page = (int)App::$Request->query->get('page'); |
|
| 479 | - $userPerPage = (int)$cfgs['usersOnPage']; |
|
| 477 | + $records = ProfileRecords::where('nick', 'like', '%'.$model->query.'%'); |
|
| 478 | + $page = (int) App::$Request->query->get('page'); |
|
| 479 | + $userPerPage = (int) $cfgs['usersOnPage']; |
|
| 480 | 480 | if ($userPerPage < 1) { |
| 481 | 481 | $userPerPage = 1; |
| 482 | 482 | } |
@@ -498,7 +498,7 @@ discard block |
||
| 498 | 498 | 'model' => $model->filter(), |
| 499 | 499 | 'records' => $records, |
| 500 | 500 | 'pagination' => $pagination, |
| 501 | - 'ratingOn' => (int)$cfgs['rating'] |
|
| 501 | + 'ratingOn' => (int) $cfgs['rating'] |
|
| 502 | 502 | ]); |
| 503 | 503 | } |
| 504 | 504 | |
@@ -522,7 +522,7 @@ discard block |
||
| 522 | 522 | // build sitemap from content items via business model |
| 523 | 523 | $sitemap = new EntityBuildMap($langs); |
| 524 | 524 | foreach ($profiles->get() as $user) { |
| 525 | - $sitemap->add('profile/show/' . $user->user_id, $user->updated_at, 'weekly', 0.2); |
|
| 525 | + $sitemap->add('profile/show/'.$user->user_id, $user->updated_at, 'weekly', 0.2); |
|
| 526 | 526 | } |
| 527 | 527 | |
| 528 | 528 | $sitemap->save('profile'); |