Passed
Push — master ( 347935...cc7747 )
by Mihail
05:42
created
Apps/View/Admin/default/main/routing.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -95,5 +95,5 @@
 block discarded – undo
95 95
 </div>
96 96
 <?php if (count($staticItems) < 1 && count($dynamicItems) < 1): ?>
97 97
     <p class="alert alert-warning"><?= __('Custom routes is not yet found') ?></p>
98
-<?php endif ;?>
99
-<?= Url::link(['main/addroute'], '<i class="fa fa-plus"></i> ' . __('New route'), ['class' => 'btn btn-primary']) ?>
100 98
\ No newline at end of file
99
+<?php endif; ?>
100
+<?= Url::link(['main/addroute'], '<i class="fa fa-plus"></i> '.__('New route'), ['class' => 'btn btn-primary']) ?>
101 101
\ No newline at end of file
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/Profile.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,5 @@
 block discarded – undo
1 1
 <?php
2 2
 use Ffcms\Core\Helper\Date;
3
-use Ffcms\Core\Helper\Text;
4 3
 use Ffcms\Core\Helper\Url;
5 4
 use Apps\Model\Api\Comments\EntityCommentData;
6 5
 
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
         $records = null;
53 53
 
54 54
         // set current page and offset
55
-        $page = (int)$this->request->query->get('page', 0);
55
+        $page = (int) $this->request->query->get('page', 0);
56 56
         $cfgs = Serialize::decode($this->application->configs);
57
-        $userPerPage = (int)$cfgs['usersOnPage'];
57
+        $userPerPage = (int) $cfgs['usersOnPage'];
58 58
         if ($userPerPage < 1) {
59 59
             $userPerPage = 1;
60 60
         }
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         switch ($filter_name) {
64 64
             case 'rating': // rating list, order by rating DESC
65 65
                 // check if rating is enabled
66
-                if ((int)$cfgs['rating'] !== 1) {
66
+                if ((int) $cfgs['rating'] !== 1) {
67 67
                     throw new NotFoundException();
68 68
                 }
69 69
                 $records = (new ProfileRecords())->orderBy('rating', 'DESC');
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
                 if (Str::likeEmpty($filter_value)) {
73 73
                     throw new NotFoundException();
74 74
                 }
75
-                $records = (new ProfileRecords())->where('hobby', 'like', '%' . $filter_value . '%');
75
+                $records = (new ProfileRecords())->where('hobby', 'like', '%'.$filter_value.'%');
76 76
                 break;
77 77
             case 'city':
78 78
                 if (Str::likeEmpty($filter_value)) {
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
                 if ($filter_value === null || !Obj::isLikeInt($filter_value)) {
85 85
                     throw new NotFoundException();
86 86
                 }
87
-                $records = (new ProfileRecords())->where('birthday', 'like', $filter_value . '-%');
87
+                $records = (new ProfileRecords())->where('birthday', 'like', $filter_value.'-%');
88 88
                 break;
89 89
             case 'all':
90 90
                 $records = (new ProfileRecords())->orderBy('id', 'DESC');
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
             'pagination' => $pagination,
108 108
             'id' => $filter_name,
109 109
             'add' => $filter_value,
110
-            'ratingOn' => (int)$cfgs['rating']
110
+            'ratingOn' => (int) $cfgs['rating']
111 111
         ]);
112 112
     }
113 113
 
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
     public function actionShow($userId)
124 124
     {
125 125
         $cfg = Serialize::decode($this->application->configs);
126
-        if ((int)$cfg['guestView'] !== 1 && !App::$User->isAuth()) {
126
+        if ((int) $cfg['guestView'] !== 1 && !App::$User->isAuth()) {
127 127
             throw new ForbiddenException(__('You must login to view other profile'));
128 128
         }
129 129
         // check if target exists
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
                     App::$Session->getFlashBag()->add('error', __('This user are in your black list or you are in blacklist!'));
146 146
                 } else {
147 147
                     // check if message added
148
-                    if ($wallModel->makePost($targetPersone, $viewerPersone, (int)$cfg['delayBetweenPost'])) {
148
+                    if ($wallModel->makePost($targetPersone, $viewerPersone, (int) $cfg['delayBetweenPost'])) {
149 149
                         App::$Session->getFlashBag()->add('success', __('The message was successful posted!'));
150 150
                     } else {
151 151
                         App::$Session->getFlashBag()->add('warning', __('Posting message was failed! Please, wait few seconds'));
@@ -156,8 +156,8 @@  discard block
 block discarded – undo
156 156
 
157 157
         $query = $targetPersone->getWall(); // relation hasMany from users to walls
158 158
         // pagination and query params
159
-        $wallPage = (int)$this->request->query->get('page');
160
-        $wallItems = (int)$cfg['wallPostOnPage'];
159
+        $wallPage = (int) $this->request->query->get('page');
160
+        $wallItems = (int) $cfg['wallPostOnPage'];
161 161
         $wallOffset = $wallPage * $wallItems;
162 162
 
163 163
         // build pagination
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
             'notify' => App::$Session->getFlashBag()->all(),
180 180
             'wallRecords' => $wallRecords,
181 181
             'pagination' => $wallPagination,
182
-            'ratingOn' => (int)$cfg['rating'] === 1
182
+            'ratingOn' => (int) $cfg['rating'] === 1
183 183
         ]);
184 184
     }
185 185
 
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
         $wallModel = new FormWallPostDelete($wallPost);
252 252
         if ($wallModel->send() && $wallModel->validate()) {
253 253
             $wallModel->make();
254
-            $this->response->redirect('profile/show/' . $wallPost->target_id);
254
+            $this->response->redirect('profile/show/'.$wallPost->target_id);
255 255
         }
256 256
 
257 257
         return $this->view->render('wall_delete', [
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
         }
292 292
 
293 293
         // get page index and current user object
294
-        $page = (int)$this->request->query->get('page', 0);
294
+        $page = (int) $this->request->query->get('page', 0);
295 295
         $offset = $page * static::NOTIFY_PER_PAGE;
296 296
         $user = App::$User->identity();
297 297
 
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
 
405 405
         // set user id from ?id= get param if form not sended
406 406
         if (!$model->send()) {
407
-            $uid = (int)$this->request->query->get('id');
407
+            $uid = (int) $this->request->query->get('id');
408 408
             if ($uid > 0) {
409 409
                 $model->id = $uid;
410 410
             }
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
         // get blocked users
423 423
         $records = Blacklist::where('user_id', '=', $user->getId());
424 424
 
425
-        $page = (int)$this->request->query->get('page');
425
+        $page = (int) $this->request->query->get('page');
426 426
         $offset = $page * self::BLOCK_PER_PAGE;
427 427
 
428 428
         // build pagination
@@ -527,9 +527,9 @@  discard block
 block discarded – undo
527 527
         // check if request is sended
528 528
         if ($model->send() && $model->validate()) {
529 529
             // get records from db
530
-            $records = ProfileRecords::where('nick', 'like', '%' . $model->query . '%');
531
-            $page = (int)$this->request->query->get('page');
532
-            $userPerPage = (int)$cfgs['usersOnPage'];
530
+            $records = ProfileRecords::where('nick', 'like', '%'.$model->query.'%');
531
+            $page = (int) $this->request->query->get('page');
532
+            $userPerPage = (int) $cfgs['usersOnPage'];
533 533
             if ($userPerPage < 1) {
534 534
                 $userPerPage = 1;
535 535
             }
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
             'model' => $model->filter(),
552 552
             'records' => $records,
553 553
             'pagination' => $pagination,
554
-            'ratingOn' => (int)$cfgs['rating']
554
+            'ratingOn' => (int) $cfgs['rating']
555 555
         ]);
556 556
     }
557 557
 
@@ -575,7 +575,7 @@  discard block
 block discarded – undo
575 575
         // build sitemap from content items via business model
576 576
         $sitemap = new EntityBuildMap($langs);
577 577
         foreach ($profiles->get() as $user) {
578
-            $sitemap->add('profile/show/' . $user->user_id, $user->updated_at, 'weekly', 0.2);
578
+            $sitemap->add('profile/show/'.$user->user_id, $user->updated_at, 'weekly', 0.2);
579 579
         }
580 580
 
581 581
         $sitemap->save('profile');
Please login to merge, or discard this patch.
Apps/Model/Front/Profile/FormWallPost.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -2,11 +2,9 @@
 block discarded – undo
2 2
 
3 3
 namespace Apps\Model\Front\Profile;
4 4
 
5
-use Apps\ActiveRecord\Blacklist;
6 5
 use Apps\ActiveRecord\WallPost as WallRecords;
7 6
 use Ffcms\Core\App;
8 7
 use Ffcms\Core\Helper\Text;
9
-use Ffcms\Core\Helper\Url;
10 8
 use Ffcms\Core\Interfaces\iUser;
11 9
 use Ffcms\Core\Arch\Model;
12 10
 use Ffcms\Core\Helper\Date;
Please login to merge, or discard this 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.
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/Sitemap/EntityIndexList.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -47,10 +47,10 @@  discard block
 block discarded – undo
47 47
         $scan = File::listFiles(static::INDEX_PATH, ['.xml'], true);
48 48
         if (Obj::isArray($scan)) {
49 49
             foreach ($scan as $file) {
50
-                if ($this->_lang !== null && !Str::contains('.' . $this->_lang, $file)) {
50
+                if ($this->_lang !== null && !Str::contains('.'.$this->_lang, $file)) {
51 51
                     continue;
52 52
                 }
53
-                $this->files[] = static::INDEX_PATH . '/' . $file;
53
+                $this->files[] = static::INDEX_PATH.'/'.$file;
54 54
             }
55 55
         }
56 56
     }
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         // build file information data
68 68
         foreach ($this->files as $file) {
69 69
             $this->info[] = [
70
-                'loc' => App::$Alias->scriptUrl . $file,
70
+                'loc' => App::$Alias->scriptUrl.$file,
71 71
                 'lastmod' => Date::convertToDatetime(File::mTime($file), 'c')
72 72
             ];
73 73
         }
Please login to merge, or discard this patch.
Apps/Model/Front/Profile/EntityNotificationsList.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
             $this->items[] = [
59 59
                 'text' => $text,
60 60
                 'date' => Date::humanize($record->created_at),
61
-                'new' => (bool)$record->readed === false
61
+                'new' => (bool) $record->readed === false
62 62
             ];
63 63
         }
64 64
     }
Please login to merge, or discard this patch.