Passed
Push — master ( c2a29b...80000e )
by Mihail
04:08
created
Apps/View/Admin/default/comments/comment_read.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
     <div class="panel-heading">
55 55
         <?php
56 56
         $answerAuthor = Simplify::parseUserNick($answer->user_id, $answer->guest_name);
57
-        if ((int)$answer->user_id > 0) {
57
+        if ((int) $answer->user_id > 0) {
58 58
             $answerAuthor = Url::link(['user/update', $answer->user_id], $answerAuthor);
59 59
         }
60 60
         ?>
Please login to merge, or discard this patch.
Apps/Controller/Api/Profile.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Apps/View/Admin/default/comments/delete.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,8 +32,8 @@
 block discarded – undo
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
     
Please login to merge, or discard this patch.
Apps/View/Admin/default/comments/answer_list.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
Apps/Controller/Admin/Comments.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
Apps/View/Front/default/content/list.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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) {
Please login to merge, or discard this patch.
Apps/View/Front/default/content/read.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -42,14 +42,14 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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) {
Please login to merge, or discard this patch.
Apps/View/Front/default/content/_rate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Apps/Model/Front/Content/EntityContentRead.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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()) {
Please login to merge, or discard this patch.