@@ -71,7 +71,7 @@ |
||
| 71 | 71 | } else { |
| 72 | 72 | // set level marker based on slashes count in pathway |
| 73 | 73 | $slashCount = Str::entryCount($path, '/'); |
| 74 | - for ($i=-1; $i <= $slashCount; $i++) { |
|
| 74 | + for ($i = -1; $i <= $slashCount; $i++) { |
|
| 75 | 75 | $title .= '--'; |
| 76 | 76 | } |
| 77 | 77 | } |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | // convert id to real integer |
| 26 | - $user_id = (int)$user_id; |
|
| 26 | + $user_id = (int) $user_id; |
|
| 27 | 27 | |
| 28 | 28 | if (!Obj::isInt($user_id) || $user_id < 1) { |
| 29 | 29 | return null; |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | public function getId() |
| 53 | 53 | { |
| 54 | - return (int)$this->id; |
|
| 54 | + return (int) $this->id; |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /** |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | { |
| 74 | 74 | // get data from session |
| 75 | 75 | $session_token = MainApp::$Session->get('ff_user_token', null); |
| 76 | - $session_id = (int)MainApp::$Session->get('ff_user_id', 0); |
|
| 76 | + $session_id = (int) MainApp::$Session->get('ff_user_id', 0); |
|
| 77 | 77 | |
| 78 | 78 | // validate session data |
| 79 | 79 | if (null === $session_token || $session_id < 1 || Str::length($session_token) < 64) { |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | // convert id to real integer |
| 110 | - $id = (int)$id; |
|
| 110 | + $id = (int) $id; |
|
| 111 | 111 | |
| 112 | 112 | $find = MainApp::$Memory->get('user.counter.cache.' . $id); |
| 113 | 113 | if ($find === null) { |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | public function actionIndex() |
| 33 | 33 | { |
| 34 | 34 | // set current page and offset |
| 35 | - $page = (int)App::$Request->query->get('page'); |
|
| 35 | + $page = (int) App::$Request->query->get('page'); |
|
| 36 | 36 | $offset = $page * self::ITEM_PER_PAGE; |
| 37 | 37 | |
| 38 | 38 | $query = null; |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | if ($type === 'trash') { |
| 42 | 42 | $query = ContentEntity::onlyTrashed(); |
| 43 | 43 | } elseif (Obj::isLikeInt($type)) { // sounds like category id ;) |
| 44 | - $query = ContentEntity::where('category_id', '=', (int)$type); |
|
| 44 | + $query = ContentEntity::where('category_id', '=', (int) $type); |
|
| 45 | 45 | } else { |
| 46 | 46 | $query = new ContentEntity(); |
| 47 | 47 | $type = 'all'; |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | if ($model->send() && $model->validate()) { |
| 184 | 184 | // remove all trashed items |
| 185 | 185 | foreach ($records->get() as $item) { |
| 186 | - $galleryPath = '/upload/gallery/' . (int)$item->id; |
|
| 186 | + $galleryPath = '/upload/gallery/' . (int) $item->id; |
|
| 187 | 187 | if (Directory::exist($galleryPath)) { |
| 188 | 188 | Directory::remove($galleryPath); |
| 189 | 189 | } |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | public function actionCategoryupdate($id = null) |
| 254 | 254 | { |
| 255 | 255 | // get owner id for new rows |
| 256 | - $parentId = (int)App::$Request->query->get('parent'); |
|
| 256 | + $parentId = (int) App::$Request->query->get('parent'); |
|
| 257 | 257 | |
| 258 | 258 | // get relation and pass to model |
| 259 | 259 | $record = ContentCategory::findOrNew($id); |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | $query = new UserRecords(); |
| 27 | 27 | |
| 28 | 28 | // set current page and offset |
| 29 | - $page = (int)App::$Request->query->get('page'); |
|
| 29 | + $page = (int) App::$Request->query->get('page'); |
|
| 30 | 30 | $offset = $page * self::ITEM_PER_PAGE; |
| 31 | 31 | |
| 32 | 32 | // build pagination |
@@ -36,9 +36,9 @@ discard block |
||
| 36 | 36 | $records = null; |
| 37 | 37 | |
| 38 | 38 | // set current page and offset |
| 39 | - $page = (int)App::$Request->query->get('page'); |
|
| 39 | + $page = (int) App::$Request->query->get('page'); |
|
| 40 | 40 | $cfgs = Serialize::decode($this->application->configs); |
| 41 | - $userPerPage = (int)$cfgs['usersOnPage']; |
|
| 41 | + $userPerPage = (int) $cfgs['usersOnPage']; |
|
| 42 | 42 | if ($userPerPage < 1) { |
| 43 | 43 | $userPerPage = 1; |
| 44 | 44 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | switch ($filter_name) { |
| 48 | 48 | case 'rating': // rating list, order by rating DESC |
| 49 | 49 | // check if rating is enabled |
| 50 | - if ((int)$cfgs['rating'] !== 1) { |
|
| 50 | + if ((int) $cfgs['rating'] !== 1) { |
|
| 51 | 51 | throw new NotFoundException(); |
| 52 | 52 | } |
| 53 | 53 | $records = (new ProfileRecords())->orderBy('rating', 'DESC'); |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | 'pagination' => $pagination, |
| 92 | 92 | 'id' => $filter_name, |
| 93 | 93 | 'add' => $filter_value, |
| 94 | - 'ratingOn' => (int)$cfgs['rating'] |
|
| 94 | + 'ratingOn' => (int) $cfgs['rating'] |
|
| 95 | 95 | ]); |
| 96 | 96 | } |
| 97 | 97 | |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | public function actionShow($userId) |
| 105 | 105 | { |
| 106 | 106 | $cfg = Serialize::decode($this->application->configs); |
| 107 | - if ((int)$cfg['guestView'] !== 1 && !App::$User->isAuth()) { |
|
| 107 | + if ((int) $cfg['guestView'] !== 1 && !App::$User->isAuth()) { |
|
| 108 | 108 | throw new ForbiddenException('You must be registered user to view other profile'); |
| 109 | 109 | } |
| 110 | 110 | // check if target exists |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | App::$Session->getFlashBag()->add('error', __('This user are in your black list or you are in blacklist!')); |
| 127 | 127 | } else { |
| 128 | 128 | // check if message added |
| 129 | - if ($wallModel->makePost($targetPersone, $viewerPersone, (int)$cfg['delayBetweenPost'])) { |
|
| 129 | + if ($wallModel->makePost($targetPersone, $viewerPersone, (int) $cfg['delayBetweenPost'])) { |
|
| 130 | 130 | App::$Session->getFlashBag()->add('success', __('The message was successful posted!')); |
| 131 | 131 | } else { |
| 132 | 132 | App::$Session->getFlashBag()->add('warning', __('Posting message was failed! You need to wait some time...')); |
@@ -137,8 +137,8 @@ discard block |
||
| 137 | 137 | |
| 138 | 138 | $query = $targetPersone->getWall(); // relation hasMany from users to walls |
| 139 | 139 | // pagination and query params |
| 140 | - $wallPage = (int)App::$Request->query->get('page'); |
|
| 141 | - $wallItems = (int)$cfg['wallPostOnPage']; |
|
| 140 | + $wallPage = (int) App::$Request->query->get('page'); |
|
| 141 | + $wallItems = (int) $cfg['wallPostOnPage']; |
|
| 142 | 142 | $wallOffset = $wallPage * $wallItems; |
| 143 | 143 | |
| 144 | 144 | // build pagination |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | 'notify' => App::$Session->getFlashBag()->all(), |
| 161 | 161 | 'wallRecords' => $wallRecords, |
| 162 | 162 | 'pagination' => $wallPagination, |
| 163 | - 'ratingOn' => (int)$cfg['rating'] === 1 |
|
| 163 | + 'ratingOn' => (int) $cfg['rating'] === 1 |
|
| 164 | 164 | ]); |
| 165 | 165 | } |
| 166 | 166 | |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | |
| 321 | 321 | // set user id from ?id= get param if form not sended |
| 322 | 322 | if (!$model->send()) { |
| 323 | - $uid = (int)App::$Request->query->get('id'); |
|
| 323 | + $uid = (int) App::$Request->query->get('id'); |
|
| 324 | 324 | if ($uid > 0) { |
| 325 | 325 | $model->id = $uid; |
| 326 | 326 | } |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | // get blocked users |
| 339 | 339 | $records = Blacklist::where('user_id', '=', $user->getId()); |
| 340 | 340 | |
| 341 | - $page = (int)App::$Request->query->get('page'); |
|
| 341 | + $page = (int) App::$Request->query->get('page'); |
|
| 342 | 342 | $offset = $page * self::BLOCK_PER_PAGE; |
| 343 | 343 | |
| 344 | 344 | // build pagination |
@@ -411,15 +411,15 @@ discard block |
||
| 411 | 411 | if ($model->send() && $model->validate()) { |
| 412 | 412 | // get records from db |
| 413 | 413 | $records = ProfileRecords::where('nick', 'like', '%' . $model->query . '%'); |
| 414 | - $page = (int)App::$Request->query->get('page'); |
|
| 415 | - $userPerPage = (int)$cfgs['usersOnPage']; |
|
| 414 | + $page = (int) App::$Request->query->get('page'); |
|
| 415 | + $userPerPage = (int) $cfgs['usersOnPage']; |
|
| 416 | 416 | if ($userPerPage < 1) { |
| 417 | 417 | $userPerPage = 1; |
| 418 | 418 | } |
| 419 | 419 | $offset = $page * $userPerPage; |
| 420 | 420 | // build pagination |
| 421 | 421 | $pagination = new SimplePagination([ |
| 422 | - 'url' => ['profile/search', null, null, [$model->getFormName().'[query]' => $model->query, $model->getFormName().'[submit]' => true]], |
|
| 422 | + 'url' => ['profile/search', null, null, [$model->getFormName() . '[query]' => $model->query, $model->getFormName() . '[submit]' => true]], |
|
| 423 | 423 | 'page' => $page, |
| 424 | 424 | 'step' => $userPerPage, |
| 425 | 425 | 'total' => $records->count() |
@@ -434,7 +434,7 @@ discard block |
||
| 434 | 434 | 'model' => $model->export(), |
| 435 | 435 | 'records' => $records, |
| 436 | 436 | 'pagination' => $pagination, |
| 437 | - 'ratingOn' => (int)$cfgs['rating'] |
|
| 437 | + 'ratingOn' => (int) $cfgs['rating'] |
|
| 438 | 438 | ]); |
| 439 | 439 | } |
| 440 | 440 | } |
| 441 | 441 | \ No newline at end of file |
@@ -110,7 +110,7 @@ |
||
| 110 | 110 | $response = []; |
| 111 | 111 | foreach ($data as $key=>$val) { |
| 112 | 112 | if ($this->_record->id !== $key) { |
| 113 | - $response[] = (string)$key; |
|
| 113 | + $response[] = (string) $key; |
|
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | return $response; |
@@ -102,7 +102,7 @@ |
||
| 102 | 102 | ]; |
| 103 | 103 | |
| 104 | 104 | // general category |
| 105 | - if ($this->_new === false && (int)$this->_record->id === 1) { |
|
| 105 | + if ($this->_new === false && (int) $this->_record->id === 1) { |
|
| 106 | 106 | $rules[] = ['path', 'used']; |
| 107 | 107 | } else { |
| 108 | 108 | $rules[] = ['path', 'required']; |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | public function rules() |
| 83 | 83 | { |
| 84 | - $res = [ |
|
| 84 | + $res = [ |
|
| 85 | 85 | ['title.' . App::$Request->getLanguage(), 'required'], |
| 86 | 86 | ['text.' . App::$Request->getLanguage(), 'required', null, true, true], |
| 87 | 87 | ['text', 'used', null, true, true], |
@@ -142,8 +142,8 @@ discard block |
||
| 142 | 142 | $this->_content->meta_description = Serialize::encode(App::$Security->strip_tags($this->metaDescription)); |
| 143 | 143 | $this->_content->source = App::$Security->strip_tags($this->source); |
| 144 | 144 | // check if rating is changed |
| 145 | - if ((int)$this->addRating !== 0) { |
|
| 146 | - $this->_content->rating += (int)$this->addRating; |
|
| 145 | + if ((int) $this->addRating !== 0) { |
|
| 146 | + $this->_content->rating += (int) $this->addRating; |
|
| 147 | 147 | } |
| 148 | 148 | // check if special comment hash is exist |
| 149 | 149 | if ($this->_new || Str::length($this->_content->comment_hash) < 32) { |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | $data = ContentCategory::getSortedCategories(); |
| 182 | 182 | $response = []; |
| 183 | 183 | foreach ($data as $key=>$val) { |
| 184 | - $response[] = (string)$key; |
|
| 184 | + $response[] = (string) $key; |
|
| 185 | 185 | } |
| 186 | 186 | return $response; |
| 187 | 187 | } |
@@ -98,7 +98,7 @@ |
||
| 98 | 98 | if ($this->newpassword !== null && Str::length($this->newpassword) >= 3) { |
| 99 | 99 | $this->_user->password = App::$Security->password_hash($this->newpassword); |
| 100 | 100 | } |
| 101 | - } elseif($property === 'approve_token') { |
|
| 101 | + } elseif ($property === 'approve_token') { |
|
| 102 | 102 | if ($value == "1") { |
| 103 | 103 | $this->_user->approve_token = '0'; |
| 104 | 104 | } else { |