Passed
Push — master ( 1fadb0...f949a1 )
by Mihail
08:15
created
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 2 patches
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.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 namespace Apps\Model\Front\Profile;
4 4
 
5 5
 use Apps\ActiveRecord\Blacklist;
6
-use Ffcms\Core\App;
7 6
 use Ffcms\Core\Arch\Model;
8 7
 use Ffcms\Core\Interfaces\iUser;
9 8
 
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/Feedback/FormAnswerAdd.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
 
26 26
     /**
27 27
      * FormAnswerAdd constructor. Pass active record of comment post and user id
28
-     * @param $recordPost
28
+     * @param \Ffcms\Core\Arch\ActiveModel $recordPost
29 29
      * @param int $userId
30 30
      */
31 31
     public function __construct($recordPost, $userId = 0)
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     public function __construct($recordPost, $userId = 0)
32 32
     {
33 33
         $this->_post = $recordPost;
34
-        $this->_userId = (int)$userId;
34
+        $this->_userId = (int) $userId;
35 35
         parent::__construct();
36 36
     }
37 37
 
@@ -98,9 +98,9 @@  discard block
 block discarded – undo
98 98
 
99 99
         // add notification msg
100 100
         $targetId = $this->_post->user_id;
101
-        if ($targetId !== null && (int)$targetId > 0 && $targetId !== $this->_userId) {
101
+        if ($targetId !== null && (int) $targetId > 0 && $targetId !== $this->_userId) {
102 102
             $notify = new EntityAddNotification($targetId);
103
-            $uri = '/feedback/read/' . $this->_post->id . '/' . $this->_post->hash . '#feedback-answer-' . $record->id;
103
+            $uri = '/feedback/read/'.$this->_post->id.'/'.$this->_post->hash.'#feedback-answer-'.$record->id;
104 104
             $notify->add($uri, EntityAddNotification::MSG_ADD_FEEDBACKANSWER, [
105 105
                 'snippet' => Text::snippet(App::$Security->strip_tags($this->message), 50),
106 106
                 'post' => Text::snippet(App::$Security->strip_tags($this->_post->message), 50)
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.
Private/Database/install.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -5,30 +5,30 @@
 block discarded – undo
5 5
 }
6 6
 
7 7
 // require all tables
8
-require_once(root . '/Private/Database/Tables/App.php');
9
-require_once(root . '/Private/Database/Tables/Blacklist.php');
10
-require_once(root . '/Private/Database/Tables/CommentAnswer.php');
11
-require_once(root . '/Private/Database/Tables/CommentPost.php');
12
-require_once(root . '/Private/Database/Tables/Content.php');
13
-require_once(root . '/Private/Database/Tables/ContentCategory.php');
14
-require_once(root . '/Private/Database/Tables/ContentRating.php');
15
-require_once(root . '/Private/Database/Tables/ContentTag.php');
16
-require_once(root . '/Private/Database/Tables/FeedbackAnswer.php');
17
-require_once(root . '/Private/Database/Tables/FeedbackPost.php');
18
-require_once(root . '/Private/Database/Tables/Invite.php');
19
-require_once(root . '/Private/Database/Tables/Message.php');
20
-require_once(root . '/Private/Database/Tables/Profile.php');
21
-require_once(root . '/Private/Database/Tables/ProfileField.php');
22
-require_once(root . '/Private/Database/Tables/ProfileRating.php');
23
-require_once(root . '/Private/Database/Tables/Role.php');
24
-require_once(root . '/Private/Database/Tables/Session.php');
25
-require_once(root . '/Private/Database/Tables/User.php');
26
-require_once(root . '/Private/Database/Tables/UserLog.php');
27
-require_once(root . '/Private/Database/Tables/UserNotification.php');
28
-require_once(root . '/Private/Database/Tables/UserProvider.php');
29
-require_once(root . '/Private/Database/Tables/UserRecovery.php');
30
-require_once(root . '/Private/Database/Tables/WallPost.php');
31
-require_once(root . '/Private/Database/Tables/WallAnswer.php');
8
+require_once(root.'/Private/Database/Tables/App.php');
9
+require_once(root.'/Private/Database/Tables/Blacklist.php');
10
+require_once(root.'/Private/Database/Tables/CommentAnswer.php');
11
+require_once(root.'/Private/Database/Tables/CommentPost.php');
12
+require_once(root.'/Private/Database/Tables/Content.php');
13
+require_once(root.'/Private/Database/Tables/ContentCategory.php');
14
+require_once(root.'/Private/Database/Tables/ContentRating.php');
15
+require_once(root.'/Private/Database/Tables/ContentTag.php');
16
+require_once(root.'/Private/Database/Tables/FeedbackAnswer.php');
17
+require_once(root.'/Private/Database/Tables/FeedbackPost.php');
18
+require_once(root.'/Private/Database/Tables/Invite.php');
19
+require_once(root.'/Private/Database/Tables/Message.php');
20
+require_once(root.'/Private/Database/Tables/Profile.php');
21
+require_once(root.'/Private/Database/Tables/ProfileField.php');
22
+require_once(root.'/Private/Database/Tables/ProfileRating.php');
23
+require_once(root.'/Private/Database/Tables/Role.php');
24
+require_once(root.'/Private/Database/Tables/Session.php');
25
+require_once(root.'/Private/Database/Tables/User.php');
26
+require_once(root.'/Private/Database/Tables/UserLog.php');
27
+require_once(root.'/Private/Database/Tables/UserNotification.php');
28
+require_once(root.'/Private/Database/Tables/UserProvider.php');
29
+require_once(root.'/Private/Database/Tables/UserRecovery.php');
30
+require_once(root.'/Private/Database/Tables/WallPost.php');
31
+require_once(root.'/Private/Database/Tables/WallAnswer.php');
32 32
 
33 33
 // use default preset (for none or other presets)
34
-require_once (root . '/Private/Database/Other/PresetDefault.php');
35 34
\ No newline at end of file
35
+require_once (root.'/Private/Database/Other/PresetDefault.php');
36 36
\ No newline at end of file
Please login to merge, or discard this patch.
Private/Config/Cron.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php return [
2
-	'instances' => [
3
-		'Apps\Controller\Front\Content::buildSitemapSchedule' => 10800,
4
-		'Apps\Controller\Front\Profile::buildSitemapSchedule' => 10800,
5
-		'Apps\Controller\Front\Profile::cleanupTablesSchedule' => 86400
6
-	]
2
+    'instances' => [
3
+        'Apps\Controller\Front\Content::buildSitemapSchedule' => 10800,
4
+        'Apps\Controller\Front\Profile::buildSitemapSchedule' => 10800,
5
+        'Apps\Controller\Front\Profile::cleanupTablesSchedule' => 86400
6
+    ]
7 7
 ];
8 8
\ No newline at end of file
Please login to merge, or discard this patch.
Private/Config/Default.php 1 patch
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -1,41 +1,41 @@
 block discarded – undo
1 1
 <?php return [
2
-	'baseProto' => 'http',
3
-	'baseDomain' => 'ffcms.app',
4
-	'basePath' => '/',
5
-	'passwordSalt' => '$2a$07$2NJgci5A7NI9m2J9Ii92a1I3DiH6$',
6
-	'timezone' => 'Europe/Moscow',
7
-	'adminEmail' => '[email protected]',
8
-	'debug' => [
9
-		'all' => false,
10
-		'cookie' => [
11
-			'key' => 'fdebug_jepP2',
12
-			'value' => 'pOH1Kj18fHN7mk9a81F32eJbl9d3AeDjLC1g7poPGE22Ii6pI68P5B6O5hKMofnLPB0lFdpo2a2o78NhedjGA'
13
-		]
14
-	],
15
-	'userCron' => false,
16
-	'theme' => [
17
-		'Front' => 'default',
18
-		'Admin' => 'default'
19
-	],
20
-	'database' => [
21
-		'driver' => 'mysql',
22
-		'host' => '127.0.0.1',
23
-		'username' => 'mysql',
24
-		'password' => 'mysql',
25
-		'database' => 'ffcms',
26
-		'prefix' => 'ffcms_',
27
-		'charset' => 'utf8',
28
-		'collation' => 'utf8_unicode_ci'
29
-	],
30
-	'baseLanguage' => 'en',
31
-	'multiLanguage' => true,
32
-	'singleLanguage' => 'en',
33
-	'languages' => [
34
-		'en',
35
-		'ru'
36
-	],
37
-	'languageDomainAlias' => false,
38
-	'gaClientId' => '570934480862-son8fr180fr6u6tlt9iqpjpoesngro0o.apps.googleusercontent.com',
39
-	'gaTrackId' => false,
40
-	'trustedProxy' => false
2
+    'baseProto' => 'http',
3
+    'baseDomain' => 'ffcms.app',
4
+    'basePath' => '/',
5
+    'passwordSalt' => '$2a$07$2NJgci5A7NI9m2J9Ii92a1I3DiH6$',
6
+    'timezone' => 'Europe/Moscow',
7
+    'adminEmail' => '[email protected]',
8
+    'debug' => [
9
+        'all' => false,
10
+        'cookie' => [
11
+            'key' => 'fdebug_jepP2',
12
+            'value' => 'pOH1Kj18fHN7mk9a81F32eJbl9d3AeDjLC1g7poPGE22Ii6pI68P5B6O5hKMofnLPB0lFdpo2a2o78NhedjGA'
13
+        ]
14
+    ],
15
+    'userCron' => false,
16
+    'theme' => [
17
+        'Front' => 'default',
18
+        'Admin' => 'default'
19
+    ],
20
+    'database' => [
21
+        'driver' => 'mysql',
22
+        'host' => '127.0.0.1',
23
+        'username' => 'mysql',
24
+        'password' => 'mysql',
25
+        'database' => 'ffcms',
26
+        'prefix' => 'ffcms_',
27
+        'charset' => 'utf8',
28
+        'collation' => 'utf8_unicode_ci'
29
+    ],
30
+    'baseLanguage' => 'en',
31
+    'multiLanguage' => true,
32
+    'singleLanguage' => 'en',
33
+    'languages' => [
34
+        'en',
35
+        'ru'
36
+    ],
37
+    'languageDomainAlias' => false,
38
+    'gaClientId' => '570934480862-son8fr180fr6u6tlt9iqpjpoesngro0o.apps.googleusercontent.com',
39
+    'gaTrackId' => false,
40
+    'trustedProxy' => false
41 41
 ];
42 42
\ No newline at end of file
Please login to merge, or discard this patch.
Apps/View/Admin/default/feedback/read.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -28,38 +28,38 @@  discard block
 block discarded – undo
28 28
         <div class="panel panel-info">
29 29
             <div class="panel-heading">
30 30
                 <?php
31
-                if ((int)$record->readed !== 1) {
31
+                if ((int) $record->readed !== 1) {
32 32
                     echo '<i class="fa fa-bell"></i> ';
33 33
                 }
34 34
                 ?>
35 35
                 <?= __('Message sent') ?>: <?= Date::convertToDatetime($record->created_at, Date::FORMAT_TO_HOUR) ?>.
36 36
                 <?php
37
-                if ((int)$record->closed !== 1) {
38
-                    echo '<span class="label label-success">' . __('Opened') . '</span>';
37
+                if ((int) $record->closed !== 1) {
38
+                    echo '<span class="label label-success">'.__('Opened').'</span>';
39 39
                 } else {
40
-                    echo '<span class="label label-danger">' . __('Closed') . '</span>';
40
+                    echo '<span class="label label-danger">'.__('Closed').'</span>';
41 41
                 }
42 42
                 ?>
43 43
             </div>
44 44
             <div class="panel-body">
45 45
                 <?php
46
-                if ((int)$record->closed !== 0) {
47
-                    echo '<p class="alert alert-warning">' . __('The feedback request is closed! Thread in only-read mode') . '.</p>';
46
+                if ((int) $record->closed !== 0) {
47
+                    echo '<p class="alert alert-warning">'.__('The feedback request is closed! Thread in only-read mode').'.</p>';
48 48
                 }
49 49
                 ?>
50 50
                 <p><?= Str::replace("\n", "<br />", $record->message) ?></p>
51 51
                 <hr />
52 52
                 <?php
53 53
                 // show "mark as read" button if message is not readed
54
-                if ((int)$record->readed !== 1) {
55
-                    echo Url::link(['feedback/turn', 'read', $record->id], __('Mark as read'), ['class' => 'label label-success']) . ' ';
54
+                if ((int) $record->readed !== 1) {
55
+                    echo Url::link(['feedback/turn', 'read', $record->id], __('Mark as read'), ['class' => 'label label-success']).' ';
56 56
                 }
57 57
 
58 58
                 // show close/open button depend of current status
59
-                if ((int)$record->closed === 0) {
60
-                    echo Url::link(['feedback/turn', 'close', $record->id], __('Close'), ['class' => 'label label-warning']) . ' ';
59
+                if ((int) $record->closed === 0) {
60
+                    echo Url::link(['feedback/turn', 'close', $record->id], __('Close'), ['class' => 'label label-warning']).' ';
61 61
                 } else {
62
-                    echo Url::link(['feedback/turn', 'open', $record->id], __('Open'), ['class' => 'label label-info']) . ' ';
62
+                    echo Url::link(['feedback/turn', 'open', $record->id], __('Open'), ['class' => 'label label-info']).' ';
63 63
                 }
64 64
 
65 65
                 ?>
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
             <div class="panel-body">
77 77
                 <?php
78 78
                 $uInfo = 'no';
79
-                if ((int)$record->user_id > 0) {
79
+                if ((int) $record->user_id > 0) {
80 80
                     $user = \App::$User->identity($record->user_id);
81 81
                     if ($user !== null && $user->getId() > 0) {
82 82
                         $uInfo = Url::link(['user/update', $user->getId()], $user->getProfile()->getNickname());
@@ -101,9 +101,9 @@  discard block
 block discarded – undo
101 101
 
102 102
 <?php if ($record->getAnswers()->count() > 0): ?>
103 103
     <?php foreach ($record->getAnswers()->get() as $answer): ?>
104
-        <div class="panel <?= (int)$answer->is_admin === 1 ? 'panel-success' : 'panel-default' ?>">
104
+        <div class="panel <?= (int) $answer->is_admin === 1 ? 'panel-success' : 'panel-default' ?>">
105 105
             <div class="panel-heading">
106
-                <?= __('From') ?>: <?= $answer->name . '(' . $answer->email . ')' . ((int)$answer->user_id > 0 ? Url::link(['user/update', $answer->user_id], '[id' . $answer->user_id . ']') : null) ?>,
106
+                <?= __('From') ?>: <?= $answer->name.'('.$answer->email.')'.((int) $answer->user_id > 0 ? Url::link(['user/update', $answer->user_id], '[id'.$answer->user_id.']') : null) ?>,
107 107
                 <?= Date::convertToDatetime($answer->created_at, Date::FORMAT_TO_HOUR) ?>
108 108
                 <span class="pull-right">
109 109
                     <?= Url::link(['feedback/update', 'answer', $answer->id], __('Edit'), ['class' => 'label label-primary']) ?>
Please login to merge, or discard this patch.