Passed
Push — master ( 89df9c...7f6cde )
by Mihail
04:52
created
Apps/Model/Front/Content/EntityCategoryList.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     {
60 60
         $this->_path = $path;
61 61
         $this->_configs = $configs;
62
-        $this->_page = (int)$offset;
62
+        $this->_page = (int) $offset;
63 63
         $this->_sort = $sort;
64 64
         parent::__construct();
65 65
     }
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     public function before()
73 73
     {
74 74
         // find one or more categories where we must looking for content items
75
-        if ((int)$this->_configs['multiCategories'] === 1) {
75
+        if ((int) $this->_configs['multiCategories'] === 1) {
76 76
             $this->findCategories();
77 77
         } else {
78 78
             $this->findCategory();
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
      */
92 92
     public function setItemLimit($limit)
93 93
     {
94
-        $this->_customItemLimit = (int)$limit;
94
+        $this->_customItemLimit = (int) $limit;
95 95
     }
96 96
 
97 97
     /**
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
     private function findCategories()
120 120
     {
121 121
         // get all categories for current path and child of it
122
-        $query = ContentCategory::where('path', 'like', $this->_path . '%');
122
+        $query = ContentCategory::where('path', 'like', $this->_path.'%');
123 123
         if ($query->count() < 1) {
124 124
             throw new NotFoundException(__('Category is not founded'));
125 125
         }
@@ -152,10 +152,10 @@  discard block
 block discarded – undo
152 152
         }
153 153
 
154 154
         // calculate selection offset
155
-        $itemPerPage = (int)$this->_configs['itemPerCategory'];
155
+        $itemPerPage = (int) $this->_configs['itemPerCategory'];
156 156
         // check if custom itemlimit defined over model api
157 157
         if ($this->_customItemLimit !== false) {
158
-            $itemPerPage = (int)$this->_customItemLimit;
158
+            $itemPerPage = (int) $this->_customItemLimit;
159 159
         }
160 160
 
161 161
         $offset = $this->_page * $itemPerPage;
@@ -197,15 +197,15 @@  discard block
 block discarded – undo
197 197
         $catConfigs = Serialize::decode($this->_currentCategory->configs);
198 198
         // prepare rss url link for current category if enabled
199 199
         $rssUrl = false;
200
-        if ((int)$this->_configs['rss'] === 1 && (int)$catConfigs['showRss'] === 1) {
201
-            $rssUrl = App::$Alias->baseUrl . '/content/rss/' . $this->_currentCategory->path;
200
+        if ((int) $this->_configs['rss'] === 1 && (int) $catConfigs['showRss'] === 1) {
201
+            $rssUrl = App::$Alias->baseUrl.'/content/rss/'.$this->_currentCategory->path;
202 202
             $rssUrl = rtrim($rssUrl, '/');
203 203
         }
204 204
 
205 205
         // prepare sorting urls
206 206
         $catSortParams = [];
207 207
         if (App::$Request->query->get('page') !== null) {
208
-            $catSortParams['page'] = (int)App::$Request->query->get('page');
208
+            $catSortParams['page'] = (int) App::$Request->query->get('page');
209 209
         }
210 210
         $catSortUrls = [
211 211
             'views' => Url::to('content/list', $this->_currentCategory->path, null, Arr::merge($catSortParams, ['sort' => 'views']), false),
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
         ];
225 225
 
226 226
         // check if this category is hidden
227
-        if ((int)$this->category['configs']['showCategory'] !== 1) {
227
+        if ((int) $this->category['configs']['showCategory'] !== 1) {
228 228
             throw new ForbiddenException(__('This category is not available to view'));
229 229
         }
230 230
 
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
             // check if current user can rate item
280 280
             $ignoredRate = App::$Session->get('content.rate.ignore');
281 281
             $canRate = true;
282
-            if (Obj::isArray($ignoredRate) && Arr::in((string)$row->id, $ignoredRate)) {
282
+            if (Obj::isArray($ignoredRate) && Arr::in((string) $row->id, $ignoredRate)) {
283 283
                 $canRate = false;
284 284
             }
285 285
             if (!App::$User->isAuth()) {
@@ -299,11 +299,11 @@  discard block
 block discarded – undo
299 299
                 'poster' => $row->getPosterUri(),
300 300
                 'thumb' => $row->getPosterThumbUri(),
301 301
                 'thumbSize' => File::size($row->getPosterThumbUri()),
302
-                'views' => (int)$row->views,
303
-                'rating' => (int)$row->rating,
302
+                'views' => (int) $row->views,
303
+                'rating' => (int) $row->rating,
304 304
                 'canRate' => $canRate,
305 305
                 'category' => $this->categories[$row->category_id],
306
-                'uri' => '/content/read/' . $itemPath,
306
+                'uri' => '/content/read/'.$itemPath,
307 307
                 'tags' => $tags
308 308
             ];
309 309
         }
Please login to merge, or discard this patch.
Apps/Model/Front/Sitemap/EntityBuildMap.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -52,16 +52,16 @@  discard block
 block discarded – undo
52 52
                 $this->data[$lang][] = [
53 53
                     'uri' => Url::standaloneUrl($uri, $lang),
54 54
                     'lastmod' => Date::convertToDatetime($lastmod, 'c'),
55
-                    'freq' => (string)$freq,
56
-                    'priority' => (float)$priority
55
+                    'freq' => (string) $freq,
56
+                    'priority' => (float) $priority
57 57
                 ];
58 58
             }
59 59
         } else { // only one language, multilanguage is disabled
60 60
             $this->data[App::$Properties->get('singleLanguage')][] = [
61 61
                 'uri' => Url::standaloneUrl($uri),
62 62
                 'lastmod' => Date::convertToDatetime($lastmod, 'c'),
63
-                'freq' => (string)$freq,
64
-                'priority' => (float)$priority
63
+                'freq' => (string) $freq,
64
+                'priority' => (float) $priority
65 65
             ];
66 66
         }
67 67
     }
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
                 'items' => $items
87 87
             ]);
88 88
             
89
-            File::write(EntityIndexList::INDEX_PATH . '/' . $uniqueName . '.' . $lang . '.xml', $xml);
89
+            File::write(EntityIndexList::INDEX_PATH.'/'.$uniqueName.'.'.$lang.'.xml', $xml);
90 90
         }
91 91
         return true;
92 92
     }
Please login to merge, or discard this patch.
Apps/Controller/Front/Content.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
     {
56 56
         $path = App::$Request->getPathWithoutControllerAction();
57 57
         $configs = $this->getConfigs();
58
-        $page = (int)App::$Request->query->get('page', 0);
59
-        $sort = (string)App::$Request->query->get('sort', 'newest');
60
-        $itemCount = (int)$configs['itemPerCategory'];
58
+        $page = (int) App::$Request->query->get('page', 0);
59
+        $sort = (string) App::$Request->query->get('sort', 'newest');
60
+        $itemCount = (int) $configs['itemPerCategory'];
61 61
 
62 62
         // build special model with content list and category list information
63 63
         $model = new EntityCategoryList($path, $configs, $page, $sort);
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         $model = new EntityContentRead($categoryRecord, $contentRecord->first());
138 138
         $search = null;
139 139
         // check if similar search is enabled for item category
140
-        if ((int)$model->getCategory()->getProperty('showSimilar') === 1 && $trash === false) {
140
+        if ((int) $model->getCategory()->getProperty('showSimilar') === 1 && $trash === false) {
141 141
             $search = new EntityContentSearch($model->title, $model->id);
142 142
         }
143 143
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
     {
168 168
         $configs = $this->getConfigs();
169 169
         // check if tags is enabled
170
-        if ((int)$configs['keywordsAsTags'] !== 1) {
170
+        if ((int) $configs['keywordsAsTags'] !== 1) {
171 171
             throw new NotFoundException(__('Tag system is disabled'));
172 172
         }
173 173
 
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
         }
181 181
 
182 182
         // get equal rows order by creation date
183
-        $records = ContentEntity::where('meta_keywords', 'like', '%' . $tagName . '%')->orderBy('created_at', 'DESC')->take(self::TAG_PER_PAGE);
183
+        $records = ContentEntity::where('meta_keywords', 'like', '%'.$tagName.'%')->orderBy('created_at', 'DESC')->take(self::TAG_PER_PAGE);
184 184
         // check if result is not empty
185 185
         if ($records->count() < 1) {
186 186
             throw new NotFoundException(__('Nothing founded'));
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
         $this->layout = null;
215 215
 
216 216
         // check if rss display allowed for this category
217
-        if ((int)$model->category['configs']['showRss'] !== 1) {
217
+        if ((int) $model->category['configs']['showRss'] !== 1) {
218 218
             throw new ForbiddenException(__('Rss feed is disabled for this category'));
219 219
         }
220 220
 
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
         // set channel data
226 226
         $channel->title($model->category['title'])
227 227
             ->description($model->category['description'])
228
-            ->url(App::$Alias->baseUrl . '/content/list/' . $model->category['path'])
228
+            ->url(App::$Alias->baseUrl.'/content/list/'.$model->category['path'])
229 229
             ->appendTo($feed);
230 230
 
231 231
         // add content data
@@ -235,10 +235,10 @@  discard block
 block discarded – undo
235 235
                 // add title, short text, url
236 236
                 $item->title($row['title'])
237 237
                     ->description($row['text'])
238
-                    ->url(App::$Alias->baseUrl . $row['uri']);
238
+                    ->url(App::$Alias->baseUrl.$row['uri']);
239 239
                 // add poster
240 240
                 if ($row['thumb'] !== null) {
241
-                    $item->enclosure(App::$Alias->scriptUrl . $row['thumb'], $row['thumbSize'], 'image/jpeg');
241
+                    $item->enclosure(App::$Alias->scriptUrl.$row['thumb'], $row['thumbSize'], 'image/jpeg');
242 242
                 }
243 243
 
244 244
                 // append response to channel
@@ -273,12 +273,12 @@  discard block
 block discarded – undo
273 273
 
274 274
         // check if user add enabled
275 275
         $configs = $this->getConfigs();
276
-        if (!(bool)$configs['userAdd']) {
276
+        if (!(bool) $configs['userAdd']) {
277 277
             throw new NotFoundException(__('User add is disabled'));
278 278
         }
279 279
 
280 280
         // prepare query
281
-        $page = (int)App::$Request->query->get('page', 0);
281
+        $page = (int) App::$Request->query->get('page', 0);
282 282
         $offset = $page * 10;
283 283
         $query = ContentRecord::where('author_id', '=', App::$User->identity()->getId());
284 284
 
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 
319 319
         // check if user add enabled
320 320
         $configs = $this->getConfigs();
321
-        if (!(bool)$configs['userAdd']) {
321
+        if (!(bool) $configs['userAdd']) {
322 322
             throw new NotFoundException(__('User add is disabled'));
323 323
         }
324 324
 
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
         $new = $record->id === null;
328 328
 
329 329
         // reject edit published items and items from other authors
330
-        if (($new === false && (int)$record->author_id !== App::$User->identity()->getId()) || (int)$record->display === 1) {
330
+        if (($new === false && (int) $record->author_id !== App::$User->identity()->getId()) || (int) $record->display === 1) {
331 331
             throw new ForbiddenException(__('You have no permissions to edit this content'));
332 332
         }
333 333
 
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
             $category = $content->getCategory();
377 377
             $uri = '/content/read/';
378 378
             if (!Str::likeEmpty($category->path)) {
379
-                $uri .= $category->path . '/';
379
+                $uri .= $category->path.'/';
380 380
             }
381 381
             $uri .= $content->path;
382 382
             $sitemap->add($uri, $content->created_at, 'weekly', 0.7);
@@ -384,8 +384,8 @@  discard block
 block discarded – undo
384 384
         // add categories
385 385
         $categories = ContentCategory::getAll();
386 386
         foreach ($categories as $item) {
387
-            if ((bool)$item->getProperty('showCategory')) {
388
-                $uri = '/content/list/' . $item->path;
387
+            if ((bool) $item->getProperty('showCategory')) {
388
+                $uri = '/content/list/'.$item->path;
389 389
                 $sitemap->add($uri, date('c'), 'daily', 0.9);
390 390
             }
391 391
         }
Please login to merge, or discard this patch.
Apps/Controller/Api/Profile.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
             $answerTime = Date::convertToTimestamp($lastAnswer->created_at);
160 160
             $cfgs = \Apps\ActiveRecord\App::getConfigs('app', 'Profile');
161 161
             // hmm, maybe past less then delay required?
162
-            if ($now - (int)$cfgs['delayBetweenPost'] < $answerTime) {
162
+            if ($now - (int) $cfgs['delayBetweenPost'] < $answerTime) {
163 163
                 throw new ForbiddenException('Delay between answers not pass');
164 164
             }
165 165
         }
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
         // add notification for target user
175 175
         if ($viewer->id !== $target_id) {
176 176
             $notify = new EntityAddNotification($target_id);
177
-            $notify->add('/profile/show/' . $target_id . '#wall-post-' . $wallRow->id, EntityAddNotification::MSG_ADD_WALLANSWER, [
177
+            $notify->add('/profile/show/'.$target_id.'#wall-post-'.$wallRow->id, EntityAddNotification::MSG_ADD_WALLANSWER, [
178 178
                 'snippet' => Text::snippet($message, 50),
179 179
                 'post' => $wallRow->message
180 180
             ]);
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
         $postInfo = $findAnswer->getWallPost();
219 219
 
220 220
         // if not a target user of answer and not answer owner - lets throw exception
221
-        if($postInfo->target_id !== $viewer->id && $findAnswer->user_id !== $viewer->id) {
221
+        if ($postInfo->target_id !== $viewer->id && $findAnswer->user_id !== $viewer->id) {
222 222
             throw new ForbiddenException('Access declined!');
223 223
         }
224 224
 
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
             // sender is not myself? then i'm - target (remote user is sender user->to_me)
280 280
             if ($row->sender_id !== $user->id) {
281 281
                 $userList[] = $row->sender_id;
282
-                if ((int)$row->tread === 0) {
282
+                if ((int) $row->tread === 0) {
283 283
                     $unreadList[] = $row->sender_id;
284 284
                 }
285 285
             }
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 
352 352
         // get special types for this action
353 353
         $queryType = App::$Request->get('type');
354
-        $queryId = (int)App::$Request->get('id');
354
+        $queryId = (int) App::$Request->get('id');
355 355
         // get current user object
356 356
         $user = App::$User->identity();
357 357
 
@@ -367,11 +367,11 @@  discard block
 block discarded – undo
367 367
         switch ($queryType) {
368 368
             case 'after':
369 369
                 $messages = Message::where('id', '>', $queryId)
370
-                    ->where(function ($query) use ($cor_id, $user) {
371
-                        $query->where(function ($q) use ($cor_id, $user){
370
+                    ->where(function($query) use ($cor_id, $user) {
371
+                        $query->where(function($q) use ($cor_id, $user){
372 372
                             $q->where('target_id', '=', $user->getId())
373 373
                                 ->where('sender_id', '=', $cor_id);
374
-                        })->orWhere(function ($q) use ($cor_id, $user){
374
+                        })->orWhere(function($q) use ($cor_id, $user){
375 375
                             $q->where('target_id', '=', $cor_id)
376 376
                                 ->where('sender_id', '=', $user->getId());
377 377
                         });
@@ -379,11 +379,11 @@  discard block
 block discarded – undo
379 379
                 break;
380 380
             case 'before':
381 381
                 $messages = Message::where('id', '<', $queryId)
382
-                    ->where(function ($query) use ($cor_id, $user) {
383
-                        $query->where(function ($q) use ($cor_id, $user){
382
+                    ->where(function($query) use ($cor_id, $user) {
383
+                        $query->where(function($q) use ($cor_id, $user){
384 384
                             $q->where('target_id', '=', $user->getId())
385 385
                                 ->where('sender_id', '=', $cor_id);
386
-                        })->orWhere(function ($q) use ($cor_id, $user){
386
+                        })->orWhere(function($q) use ($cor_id, $user){
387 387
                             $q->where('target_id', '=', $cor_id)
388 388
                                 ->where('sender_id', '=', $user->getId());
389 389
                         });
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
         $this->setJsonHeader();
492 492
 
493 493
         // get operation type and target user id
494
-        $target_id = (int)App::$Request->get('target');
494
+        $target_id = (int) App::$Request->get('target');
495 495
         $type = App::$Request->get('type');
496 496
 
497 497
         // check type of query
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
 
507 507
         $cfg = \Apps\ActiveRecord\App::getConfigs('app', 'Profile');
508 508
         // check if rating is enabled for website
509
-        if ((int)$cfg['rating'] !== 1) {
509
+        if ((int) $cfg['rating'] !== 1) {
510 510
             throw new NativeException('Rating is disabled');
511 511
         }
512 512
 
Please login to merge, or discard this patch.
Apps/Controller/Front/Profile.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -51,9 +51,9 @@  discard block
 block discarded – undo
51 51
         $records = null;
52 52
 
53 53
         // set current page and offset
54
-        $page = (int)App::$Request->query->get('page', 0);
54
+        $page = (int) App::$Request->query->get('page', 0);
55 55
         $cfgs = Serialize::decode($this->application->configs);
56
-        $userPerPage = (int)$cfgs['usersOnPage'];
56
+        $userPerPage = (int) $cfgs['usersOnPage'];
57 57
         if ($userPerPage < 1) {
58 58
             $userPerPage = 1;
59 59
         }
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         switch ($filter_name) {
63 63
             case 'rating': // rating list, order by rating DESC
64 64
                 // check if rating is enabled
65
-                if ((int)$cfgs['rating'] !== 1) {
65
+                if ((int) $cfgs['rating'] !== 1) {
66 66
                     throw new NotFoundException();
67 67
                 }
68 68
                 $records = (new ProfileRecords())->orderBy('rating', 'DESC');
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
                 if (Str::likeEmpty($filter_value)) {
72 72
                     throw new NotFoundException();
73 73
                 }
74
-                $records = (new ProfileRecords())->where('hobby', 'like', '%' . $filter_value . '%');
74
+                $records = (new ProfileRecords())->where('hobby', 'like', '%'.$filter_value.'%');
75 75
                 break;
76 76
             case 'city':
77 77
                 if (Str::likeEmpty($filter_value)) {
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
                 if ($filter_value === null || !Obj::isLikeInt($filter_value)) {
84 84
                     throw new NotFoundException();
85 85
                 }
86
-                $records = (new ProfileRecords())->where('birthday', 'like', $filter_value . '-%');
86
+                $records = (new ProfileRecords())->where('birthday', 'like', $filter_value.'-%');
87 87
                 break;
88 88
             case 'all':
89 89
                 $records = (new ProfileRecords())->orderBy('id', 'DESC');
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
             'pagination' => $pagination,
107 107
             'id' => $filter_name,
108 108
             'add' => $filter_value,
109
-            'ratingOn' => (int)$cfgs['rating']
109
+            'ratingOn' => (int) $cfgs['rating']
110 110
         ]);
111 111
     }
112 112
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
     public function actionShow($userId)
123 123
     {
124 124
         $cfg = Serialize::decode($this->application->configs);
125
-        if ((int)$cfg['guestView'] !== 1 && !App::$User->isAuth()) {
125
+        if ((int) $cfg['guestView'] !== 1 && !App::$User->isAuth()) {
126 126
             throw new ForbiddenException(__('You must login to view other profile'));
127 127
         }
128 128
         // check if target exists
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
                     App::$Session->getFlashBag()->add('error', __('This user are in your black list or you are in blacklist!'));
145 145
                 } else {
146 146
                     // check if message added
147
-                    if ($wallModel->makePost($targetPersone, $viewerPersone, (int)$cfg['delayBetweenPost'])) {
147
+                    if ($wallModel->makePost($targetPersone, $viewerPersone, (int) $cfg['delayBetweenPost'])) {
148 148
                         App::$Session->getFlashBag()->add('success', __('The message was successful posted!'));
149 149
                     } else {
150 150
                         App::$Session->getFlashBag()->add('warning', __('Posting message was failed! Please, wait few seconds'));
@@ -155,8 +155,8 @@  discard block
 block discarded – undo
155 155
 
156 156
         $query = $targetPersone->getWall(); // relation hasMany from users to walls
157 157
         // pagination and query params
158
-        $wallPage = (int)App::$Request->query->get('page');
159
-        $wallItems = (int)$cfg['wallPostOnPage'];
158
+        $wallPage = (int) App::$Request->query->get('page');
159
+        $wallItems = (int) $cfg['wallPostOnPage'];
160 160
         $wallOffset = $wallPage * $wallItems;
161 161
 
162 162
         // build pagination
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
             'notify' => App::$Session->getFlashBag()->all(),
179 179
             'wallRecords' => $wallRecords,
180 180
             'pagination' => $wallPagination,
181
-            'ratingOn' => (int)$cfg['rating'] === 1
181
+            'ratingOn' => (int) $cfg['rating'] === 1
182 182
         ]);
183 183
     }
184 184
 
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
         $wallModel = new FormWallPostDelete($wallPost);
251 251
         if ($wallModel->send() && $wallModel->validate()) {
252 252
             $wallModel->make();
253
-            App::$Response->redirect('profile/show/' . $wallPost->target_id);
253
+            App::$Response->redirect('profile/show/'.$wallPost->target_id);
254 254
         }
255 255
 
256 256
         return App::$View->render('wall_delete', [
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
         }
283 283
 
284 284
         // get page index and current user object
285
-        $page = (int)App::$Request->query->get('page', 0);
285
+        $page = (int) App::$Request->query->get('page', 0);
286 286
         $offset = $page * static::NOTIFY_PER_PAGE;
287 287
         $user = App::$User->identity();
288 288
 
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 
392 392
         // set user id from ?id= get param if form not sended
393 393
         if (!$model->send()) {
394
-            $uid = (int)App::$Request->query->get('id');
394
+            $uid = (int) App::$Request->query->get('id');
395 395
             if ($uid > 0) {
396 396
                 $model->id = $uid;
397 397
             }
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
         // get blocked users
410 410
         $records = Blacklist::where('user_id', '=', $user->getId());
411 411
 
412
-        $page = (int)App::$Request->query->get('page');
412
+        $page = (int) App::$Request->query->get('page');
413 413
         $offset = $page * self::BLOCK_PER_PAGE;
414 414
 
415 415
         // build pagination
@@ -514,9 +514,9 @@  discard block
 block discarded – undo
514 514
         // check if request is sended
515 515
         if ($model->send() && $model->validate()) {
516 516
             // get records from db
517
-            $records = ProfileRecords::where('nick', 'like', '%' . $model->query . '%');
518
-            $page = (int)App::$Request->query->get('page');
519
-            $userPerPage = (int)$cfgs['usersOnPage'];
517
+            $records = ProfileRecords::where('nick', 'like', '%'.$model->query.'%');
518
+            $page = (int) App::$Request->query->get('page');
519
+            $userPerPage = (int) $cfgs['usersOnPage'];
520 520
             if ($userPerPage < 1) {
521 521
                 $userPerPage = 1;
522 522
             }
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
             'model' => $model->filter(),
539 539
             'records' => $records,
540 540
             'pagination' => $pagination,
541
-            'ratingOn' => (int)$cfgs['rating']
541
+            'ratingOn' => (int) $cfgs['rating']
542 542
         ]);
543 543
     }
544 544
 
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
         // build sitemap from content items via business model
563 563
         $sitemap = new EntityBuildMap($langs);
564 564
         foreach ($profiles->get() as $user) {
565
-            $sitemap->add('profile/show/' . $user->user_id, $user->updated_at, 'weekly', 0.2);
565
+            $sitemap->add('profile/show/'.$user->user_id, $user->updated_at, 'weekly', 0.2);
566 566
         }
567 567
 
568 568
         $sitemap->save('profile');
Please login to merge, or discard this patch.
Apps/View/Admin/default/sitemap/index.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,19 +15,19 @@
 block discarded – undo
15 15
 <h1><?= __('Sitemap') ?></h1>
16 16
 <hr />
17 17
 <p><?= __('Sitemap its a special application to generate sitemap as xml file over sitemap standart for search engines.') ?></p>
18
-<p><?= __('Sitemap main index') ?>: <a href="<?= \App::$Alias->scriptUrl . '/sitemap' ?>" target="_blank">/sitemap</a></p>
18
+<p><?= __('Sitemap main index') ?>: <a href="<?= \App::$Alias->scriptUrl.'/sitemap' ?>" target="_blank">/sitemap</a></p>
19 19
 <h3><?= __('Sitemap files') ?></h3>
20 20
 <?php
21 21
 $items = [];
22 22
 if ($model->files === null || count($model->files) < 1) {
23
-    echo '<p class="alert alert-warning">' . __('No sitemap files found! Maybe cron manager is not configured') . '</p>';
23
+    echo '<p class="alert alert-warning">'.__('No sitemap files found! Maybe cron manager is not configured').'</p>';
24 24
     return;
25 25
 }
26 26
 
27
-foreach($model->files as $file) {
27
+foreach ($model->files as $file) {
28 28
     $items[] = [
29 29
         'type' => 'link',
30
-        'link' => \App::$Alias->scriptUrl . $file,
30
+        'link' => \App::$Alias->scriptUrl.$file,
31 31
         'text' => $file,
32 32
         'linkProperty' => ['target' => '_blank']
33 33
     ];
Please login to merge, or discard this patch.
Apps/View/Front/default/profile/notifications.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
 <hr />
18 18
 <?php
19 19
 if ($model->items === null || count($model->items) < 1) {
20
-    echo '<p class="alert alert-warning">' . __('No notifications available') . '</p>';
20
+    echo '<p class="alert alert-warning">'.__('No notifications available').'</p>';
21 21
     return;
22 22
 }
23 23
 ?>
Please login to merge, or discard this patch.
Apps/Model/Api/Comments/CommentAnswerAdd.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -49,12 +49,12 @@  discard block
 block discarded – undo
49 49
     public function check()
50 50
     {
51 51
         // check if user is auth'd or guest name is defined
52
-        if (!App::$User->isAuth() && ((int)$this->_configs['guestAdd'] !== 1 || Str::length($this->guestName) < 2)) {
52
+        if (!App::$User->isAuth() && ((int) $this->_configs['guestAdd'] !== 1 || Str::length($this->guestName) < 2)) {
53 53
             throw new JsonException(__('Guest name is not defined'));
54 54
         }
55 55
 
56 56
         // guest moderation
57
-        if (!App::$User->isAuth() && (bool)$this->_configs['guestModerate']) {
57
+        if (!App::$User->isAuth() && (bool) $this->_configs['guestModerate']) {
58 58
             $captcha = App::$Request->request->get('captcha');
59 59
             if (!App::$Captcha->validate($captcha)) {
60 60
                 throw new JsonException(__('Captcha is incorrect! Click on image to refresh and try again'));
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         }
68 68
 
69 69
         // check if message length is correct
70
-        if (Str::length($this->message) < (int)$this->_configs['minLength'] || Str::length($this->message) > (int)$this->_configs['maxLength']) {
70
+        if (Str::length($this->message) < (int) $this->_configs['minLength'] || Str::length($this->message) > (int) $this->_configs['maxLength']) {
71 71
             throw new JsonException(__('Message length is incorrect. Current: %cur%, min - %min%, max - %max%', [
72 72
                 'cur' => Str::length($this->message),
73 73
                 'min' => $this->_configs['minLength'],
@@ -112,15 +112,15 @@  discard block
 block discarded – undo
112 112
         $record->lang = App::$Request->getLanguage();
113 113
         $record->ip = $this->ip;
114 114
         // check if premoderation is enabled and user is guest
115
-        if ((bool)$this->_configs['guestModerate'] && $this->_userId < 1) {
115
+        if ((bool) $this->_configs['guestModerate'] && $this->_userId < 1) {
116 116
             $record->moderate = 1;
117 117
         }
118 118
         $record->save();
119 119
 
120 120
         // add notification for comment post owner
121 121
         $commentPost = $record->getCommentPost();
122
-        if ($commentPost !== null && (int)$commentPost->user_id !== 0 && (int)$commentPost->user_id !== $this->_userId) {
123
-            $notify = new EntityAddNotification((int)$commentPost->user_id);
122
+        if ($commentPost !== null && (int) $commentPost->user_id !== 0 && (int) $commentPost->user_id !== $this->_userId) {
123
+            $notify = new EntityAddNotification((int) $commentPost->user_id);
124 124
             $notify->add($commentPost->pathway, EntityAddNotification::MSG_ADD_COMMENTANSWER, [
125 125
                 'snippet' => Text::snippet(App::$Security->strip_tags($this->message), 50),
126 126
                 'post' => Text::snippet(App::$Security->strip_tags($commentPost->message), 50)
Please login to merge, or discard this patch.
Apps/Model/Front/Profile/FormWallPost.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
         // add user notification
63 63
         if ($target->id !== $viewer->id) {
64 64
             $notify = new EntityAddNotification($target->id);
65
-            $notify->add('profile/show/' . $target->id . '#wall-post-' . $record->id, EntityAddNotification::MSG_ADD_WALLPOST, ['snippet' => Text::snippet($this->message, 50)]);
65
+            $notify->add('profile/show/'.$target->id.'#wall-post-'.$record->id, EntityAddNotification::MSG_ADD_WALLPOST, ['snippet' => Text::snippet($this->message, 50)]);
66 66
         }
67 67
 
68 68
         // cleanup message
Please login to merge, or discard this patch.