@@ -31,7 +31,7 @@ |
||
| 31 | 31 | foreach ($records as $item) { |
| 32 | 32 | $message = Text::cut(\App::$Security->strip_tags($item->message), 0, 75); |
| 33 | 33 | $userArr = []; |
| 34 | - if ((int)$item->user_id > 0 && \App::$User->isExist($item->user_id)) { |
|
| 34 | + if ((int) $item->user_id > 0 && \App::$User->isExist($item->user_id)) { |
|
| 35 | 35 | $userName = \App::$User->identity($item->user_id)->getProfile()->getNickname(); |
| 36 | 36 | $userArr = ['text' => Url::link(['user/update', $item->user_id], $userName), 'html' => true]; |
| 37 | 37 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | public function actionIndex() |
| 39 | 39 | { |
| 40 | 40 | // set current page and offset |
| 41 | - $page = (int)App::$Request->query->get('page'); |
|
| 41 | + $page = (int) App::$Request->query->get('page'); |
|
| 42 | 42 | $offset = $page * self::ITEM_PER_PAGE; |
| 43 | 43 | |
| 44 | 44 | // initialize active record model |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | public function actionDelete($type, $id = 0) |
| 134 | 134 | { |
| 135 | 135 | // sounds like a multiply delete definition |
| 136 | - if ($id === 0 || (int)$id < 1) { |
|
| 136 | + if ($id === 0 || (int) $id < 1) { |
|
| 137 | 137 | $ids = App::$Request->query->get('selectRemove'); |
| 138 | 138 | if (Obj::isArray($ids) && Arr::onlyNumericValues($ids)) { |
| 139 | 139 | $id = $ids; |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | public function actionAnswerlist() |
| 184 | 184 | { |
| 185 | 185 | // set current page and offset |
| 186 | - $page = (int)App::$Request->query->get('page'); |
|
| 186 | + $page = (int) App::$Request->query->get('page'); |
|
| 187 | 187 | $offset = $page * self::ITEM_PER_PAGE; |
| 188 | 188 | |
| 189 | 189 | // initialize ar answers model |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | $catConfigs = []; |
| 17 | 17 | foreach ($model->category['configs'] as $key=>$value) { |
| 18 | - $catConfigs[$key] = (int)$value === 1; |
|
| 18 | + $catConfigs[$key] = (int) $value === 1; |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | $catMeta = [ |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | </div> |
| 100 | 100 | </div> |
| 101 | 101 | <div class="meta"> |
| 102 | - <?php if ((int)$catConfigs['showRating'] === 1) { |
|
| 102 | + <?php if ((int) $catConfigs['showRating'] === 1) { |
|
| 103 | 103 | echo \App::$View->render('content/_rate', [ |
| 104 | 104 | 'id' => $item['id'], |
| 105 | 105 | 'canRate' => $item['canRate'], |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | <a href="#"><?= __('Comments') ?>: <span itemprop="commentCount">0</span></a> |
| 112 | 112 | </span> |
| 113 | 113 | <span class="pull-right"> |
| 114 | - <?php if ((int)$configs['keywordsAsTags'] === 1 && $item['tags'] !== null && Obj::isArray($item['tags'])): ?> |
|
| 114 | + <?php if ((int) $configs['keywordsAsTags'] === 1 && $item['tags'] !== null && Obj::isArray($item['tags'])): ?> |
|
| 115 | 115 | <span class="spaced"><i class="fa fa-tags hidden-xs"></i> |
| 116 | 116 | <?php |
| 117 | 117 | foreach ($item['tags'] as $tag) { |
@@ -42,14 +42,14 @@ discard block |
||
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | $properties = [ |
| 45 | - 'date' => (int)$model->getCategory()->getProperty('showDate') === 1, |
|
| 46 | - 'author' => (int)$model->getCategory()->getProperty('showAuthor') === 1, |
|
| 47 | - 'views' => (int)$model->getCategory()->getProperty('showViews') === 1, |
|
| 48 | - 'category' => (int)$model->getCategory()->getProperty('showCategory') === 1, |
|
| 49 | - 'rating' => (int)$model->getCategory()->getProperty('showRating') === 1 |
|
| 45 | + 'date' => (int) $model->getCategory()->getProperty('showDate') === 1, |
|
| 46 | + 'author' => (int) $model->getCategory()->getProperty('showAuthor') === 1, |
|
| 47 | + 'views' => (int) $model->getCategory()->getProperty('showViews') === 1, |
|
| 48 | + 'category' => (int) $model->getCategory()->getProperty('showCategory') === 1, |
|
| 49 | + 'rating' => (int) $model->getCategory()->getProperty('showRating') === 1 |
|
| 50 | 50 | ]; |
| 51 | -$showComments = (int)$model->getCategory()->getProperty('showComments') === 1; |
|
| 52 | -$showPoster = (int)$model->getCategory()->getProperty('showPoster') === 1; |
|
| 51 | +$showComments = (int) $model->getCategory()->getProperty('showComments') === 1; |
|
| 52 | +$showPoster = (int) $model->getCategory()->getProperty('showPoster') === 1; |
|
| 53 | 53 | |
| 54 | 54 | \App::$Cache->set('test.me.baby.1', ['key' => 'value']); |
| 55 | 55 | ?> |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | </div> |
| 105 | 105 | </div> |
| 106 | 106 | </div> |
| 107 | - <?php endif ;?> |
|
| 107 | + <?php endif; ?> |
|
| 108 | 108 | <?= $model->text ?> |
| 109 | 109 | </div> |
| 110 | 110 | <?php if ($model->galleryItems !== null && Obj::isArray($model->galleryItems)): ?> |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | <?= \App::$View->render('content/_rateJs') ?> |
| 169 | 169 | </div> |
| 170 | 170 | <div class="pull-right"> |
| 171 | - <?php if ((int)$configs['keywordsAsTags'] === 1): ?> |
|
| 171 | + <?php if ((int) $configs['keywordsAsTags'] === 1): ?> |
|
| 172 | 172 | <div id="content-tags"> |
| 173 | 173 | <?php |
| 174 | 174 | if (Obj::isArray($model->metaKeywords) && count($model->metaKeywords) > 0 && Str::length($model->metaKeywords[0]) > 0) { |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | if ($rating > 0) { |
| 9 | 9 | $cssRatingClass = 'label-success'; |
| 10 | 10 | $numericRating = '+' . $rating; |
| 11 | -} elseif($rating < 0) { |
|
| 11 | +} elseif ($rating < 0) { |
|
| 12 | 12 | $cssRatingClass = 'label-danger'; |
| 13 | 13 | $numericRating = $rating; |
| 14 | 14 | } |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | $this->source = $this->_content->source; |
| 98 | - $this->views = $this->_content->views+1; |
|
| 98 | + $this->views = $this->_content->views + 1; |
|
| 99 | 99 | // check for dependence, add '' for general cat, ex: general/depend1/depend2/.../depend-n |
| 100 | 100 | $catNestingArray = Arr::merge([0 => ''], explode('/', $this->catPath)); |
| 101 | 101 | if ($catNestingArray > 1) { |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | $this->rating = $this->_content->rating; |
| 170 | 170 | $ignoredRate = App::$Session->get('content.rate.ignore'); |
| 171 | 171 | $this->canRate = true; |
| 172 | - if (Obj::isArray($ignoredRate) && Arr::in((string)$this->id, $ignoredRate)) { |
|
| 172 | + if (Obj::isArray($ignoredRate) && Arr::in((string) $this->id, $ignoredRate)) { |
|
| 173 | 173 | $this->canRate = false; |
| 174 | 174 | } |
| 175 | 175 | if (!App::$User->isAuth()) { |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | { |
| 54 | 54 | $this->_path = $path; |
| 55 | 55 | $this->_configs = $configs; |
| 56 | - $this->_page = (int)$offset; |
|
| 56 | + $this->_page = (int) $offset; |
|
| 57 | 57 | parent::__construct(); |
| 58 | 58 | } |
| 59 | 59 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | public function before() |
| 66 | 66 | { |
| 67 | 67 | // find one or more categories where we must looking for content items |
| 68 | - if ((int)$this->_configs['multiCategories'] === 1) { |
|
| 68 | + if ((int) $this->_configs['multiCategories'] === 1) { |
|
| 69 | 69 | $this->findCategories(); |
| 70 | 70 | } else { |
| 71 | 71 | $this->findCategory(); |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | // calculate selection offset |
| 138 | - $itemPerPage = (int)$this->_configs['itemPerCategory']; |
|
| 138 | + $itemPerPage = (int) $this->_configs['itemPerCategory']; |
|
| 139 | 139 | if ($itemPerPage < 1) { |
| 140 | 140 | $itemPerPage = 1; |
| 141 | 141 | } |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | ]; |
| 169 | 169 | |
| 170 | 170 | // check if this category is hidden |
| 171 | - if ((int)$this->category['configs']['showCategory'] !== 1) { |
|
| 171 | + if ((int) $this->category['configs']['showCategory'] !== 1) { |
|
| 172 | 172 | throw new ForbiddenException(__('This category is not available to view')); |
| 173 | 173 | } |
| 174 | 174 | |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | // check if current user can rate item |
| 213 | 213 | $ignoredRate = App::$Session->get('content.rate.ignore'); |
| 214 | 214 | $canRate = true; |
| 215 | - if (Obj::isArray($ignoredRate) && Arr::in((string)$row->id, $ignoredRate)) { |
|
| 215 | + if (Obj::isArray($ignoredRate) && Arr::in((string) $row->id, $ignoredRate)) { |
|
| 216 | 216 | $canRate = false; |
| 217 | 217 | } |
| 218 | 218 | if (!App::$User->isAuth()) { |
@@ -229,8 +229,8 @@ discard block |
||
| 229 | 229 | 'poster' => $row->getPosterUri(), |
| 230 | 230 | 'thumb' => $row->getPosterThumbUri(), |
| 231 | 231 | 'thumbSize' => File::size($row->getPosterThumbUri()), |
| 232 | - 'views' => (int)$row->views, |
|
| 233 | - 'rating' => (int)$row->rating, |
|
| 232 | + 'views' => (int) $row->views, |
|
| 233 | + 'rating' => (int) $row->rating, |
|
| 234 | 234 | 'canRate' => $canRate, |
| 235 | 235 | 'category' => $this->categories[$row->category_id], |
| 236 | 236 | 'uri' => '/content/read/' . $itemPath, |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | App::$Session->set('content.rate.ignore', $ignored); |
| 65 | 65 | |
| 66 | 66 | // save rating changes to database |
| 67 | - switch($this->_type) { |
|
| 67 | + switch ($this->_type) { |
|
| 68 | 68 | case 'plus': |
| 69 | 69 | $this->_content->rating += 1; |
| 70 | 70 | break; |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | $this->_content->save(); |
| 77 | 77 | |
| 78 | 78 | // update content author rating |
| 79 | - $authorId = (int)$this->_content->author_id; |
|
| 79 | + $authorId = (int) $this->_content->author_id; |
|
| 80 | 80 | if ($authorId > 0 && App::$User->isExist($authorId)) { |
| 81 | 81 | $authorObject = App::$User->identity($authorId); |
| 82 | 82 | if ($authorObject !== null) { |
@@ -33,12 +33,12 @@ discard block |
||
| 33 | 33 | parent::before(); |
| 34 | 34 | $configs = AppRecord::getConfigs('app', 'Content'); |
| 35 | 35 | // prevent null-type config data |
| 36 | - if ((int)$configs['gallerySize'] > 0) { |
|
| 37 | - $this->maxSize = (int)$configs['gallerySize'] * 1024; |
|
| 36 | + if ((int) $configs['gallerySize'] > 0) { |
|
| 37 | + $this->maxSize = (int) $configs['gallerySize'] * 1024; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - if ((int)$configs['galleryResize'] > 0) { |
|
| 41 | - $this->maxResize = (int)$configs['galleryResize']; |
|
| 40 | + if ((int) $configs['galleryResize'] > 0) { |
|
| 41 | + $this->maxResize = (int) $configs['galleryResize']; |
|
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | |
| 130 | 130 | // check file size |
| 131 | 131 | if ($file->getSize() < 1 || $file->getSize() > $this->maxSize) { |
| 132 | - throw new ForbiddenException(__('File size is too big. Max size: %size%kb', ['size' => intval($this->maxSize/1024)])); |
|
| 132 | + throw new ForbiddenException(__('File size is too big. Max size: %size%kb', ['size' => intval($this->maxSize / 1024)])); |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | // check file extension |