@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | $answerTime = Date::convertToTimestamp($lastAnswer->created_at); |
150 | 150 | $cfgs = \Apps\ActiveRecord\App::getConfigs('app', 'Profile'); |
151 | 151 | // hmm, maybe past less then delay required? |
152 | - if ($now - (int)$cfgs['delayBetweenPost'] < $answerTime) { |
|
152 | + if ($now - (int) $cfgs['delayBetweenPost'] < $answerTime) { |
|
153 | 153 | throw new JsonException('Delay between answers not pass'); |
154 | 154 | } |
155 | 155 | } |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | $postInfo = $findAnswer->getWallPost(); |
197 | 197 | |
198 | 198 | // if not a target user of answer and not answer owner - lets throw exception |
199 | - if($postInfo->target_id !== $viewer->id && $findAnswer->user_id !== $viewer->id) { |
|
199 | + if ($postInfo->target_id !== $viewer->id && $findAnswer->user_id !== $viewer->id) { |
|
200 | 200 | throw new JsonException('Access declined!'); |
201 | 201 | } |
202 | 202 | |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | // sender is not myself? then i'm - target (remote user is sender user->to_me) |
257 | 257 | if ($row->sender_id !== $user->id) { |
258 | 258 | $userList[] = $row->sender_id; |
259 | - if ((int)$row->tread === 0) { |
|
259 | + if ((int) $row->tread === 0) { |
|
260 | 260 | $unreadList[] = $row->sender_id; |
261 | 261 | } |
262 | 262 | } |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | |
325 | 325 | // get special types for this action |
326 | 326 | $queryType = App::$Request->get('type'); |
327 | - $queryId = (int)App::$Request->get('id'); |
|
327 | + $queryId = (int) App::$Request->get('id'); |
|
328 | 328 | // get current user object |
329 | 329 | $user = App::$User->identity(); |
330 | 330 | |
@@ -340,11 +340,11 @@ discard block |
||
340 | 340 | switch ($queryType) { |
341 | 341 | case 'after': |
342 | 342 | $messages = Message::where('id', '>', $queryId) |
343 | - ->where(function ($query) use ($cor_id, $user) { |
|
344 | - $query->where(function ($q) use ($cor_id, $user){ |
|
343 | + ->where(function($query) use ($cor_id, $user) { |
|
344 | + $query->where(function($q) use ($cor_id, $user){ |
|
345 | 345 | $q->where('target_id', '=', $user->getId()) |
346 | 346 | ->where('sender_id', '=', $cor_id); |
347 | - })->orWhere(function ($q) use ($cor_id, $user){ |
|
347 | + })->orWhere(function($q) use ($cor_id, $user){ |
|
348 | 348 | $q->where('target_id', '=', $cor_id) |
349 | 349 | ->where('sender_id', '=', $user->getId()); |
350 | 350 | }); |
@@ -352,11 +352,11 @@ discard block |
||
352 | 352 | break; |
353 | 353 | case 'before': |
354 | 354 | $messages = Message::where('id', '<', $queryId) |
355 | - ->where(function ($query) use ($cor_id, $user) { |
|
356 | - $query->where(function ($q) use ($cor_id, $user){ |
|
355 | + ->where(function($query) use ($cor_id, $user) { |
|
356 | + $query->where(function($q) use ($cor_id, $user){ |
|
357 | 357 | $q->where('target_id', '=', $user->getId()) |
358 | 358 | ->where('sender_id', '=', $cor_id); |
359 | - })->orWhere(function ($q) use ($cor_id, $user){ |
|
359 | + })->orWhere(function($q) use ($cor_id, $user){ |
|
360 | 360 | $q->where('target_id', '=', $cor_id) |
361 | 361 | ->where('sender_id', '=', $user->getId()); |
362 | 362 | }); |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | $this->setJsonHeader(); |
456 | 456 | |
457 | 457 | // get operation type and target user id |
458 | - $target_id = (int)App::$Request->get('target'); |
|
458 | + $target_id = (int) App::$Request->get('target'); |
|
459 | 459 | $type = App::$Request->get('type'); |
460 | 460 | |
461 | 461 | // check type of query |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | |
471 | 471 | $cfg = \Apps\ActiveRecord\App::getConfigs('app', 'Profile'); |
472 | 472 | // check if rating is enabled for website |
473 | - if ((int)$cfg['rating'] !== 1) { |
|
473 | + if ((int) $cfg['rating'] !== 1) { |
|
474 | 474 | throw new JsonException('Rating is disabled'); |
475 | 475 | } |
476 | 476 |
@@ -32,8 +32,8 @@ |
||
32 | 32 | foreach ($records as $item) { |
33 | 33 | $message = Str::sub(\App::$Security->strip_tags($item->message), 0, 50); |
34 | 34 | $author = Simplify::parseUserNick($item->user_id, $item->guest_name); |
35 | - if ((int)$item->user_id > 0) { |
|
36 | - $author = Url::link(['user/update', (int)$item->user_id], $author); |
|
35 | + if ((int) $item->user_id > 0) { |
|
36 | + $author = Url::link(['user/update', (int) $item->user_id], $author); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 |
@@ -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, |