Passed
Push — master ( 68443e...939347 )
by Mihail
04:31
created
Apps/Controller/Api/Comments.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
         $this->setJsonHeader();
31 31
         $configs = AppRecord::getConfigs('widget', 'Comments');
32 32
 
33
-        $replayTo = (int)App::$Request->request->get('replay-to');
33
+        $replayTo = (int) App::$Request->request->get('replay-to');
34 34
         $model = null;
35 35
         // check if its a answer (comment answer type)
36 36
         if ($replayTo > 0) {
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         }
43 43
 
44 44
         // pass general comment params to model
45
-        $model->message = App::$Security->secureHtml((string)App::$Request->request->get('message'));
45
+        $model->message = App::$Security->secureHtml((string) App::$Request->request->get('message'));
46 46
         $model->guestName = App::$Security->strip_tags(App::$Request->request->get('guest-name'));
47 47
 
48 48
         // check model conditions before add new row
@@ -74,12 +74,12 @@  discard block
 block discarded – undo
74 74
         // get configs
75 75
         $configs = AppRecord::getConfigs('widget', 'Comments');
76 76
         // items per page
77
-        $perPage = (int)$configs['perPage'];
77
+        $perPage = (int) $configs['perPage'];
78 78
         // offset can be only integer
79
-        $index = (int)$index;
79
+        $index = (int) $index;
80 80
         $offset = $perPage * $index;
81 81
         // get comment target path and check
82
-        $path = (string)App::$Request->query->get('path');
82
+        $path = (string) App::$Request->query->get('path');
83 83
         if (Str::likeEmpty($path)) {
84 84
             throw new JsonException('Wrong path');
85 85
         }
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
         $query = CommentPost::where('pathway', '=', $path);
89 89
 
90 90
         // check if comments is depend of language locale
91
-        if ((int)$configs['onlyLocale'] === 1) {
91
+        if ((int) $configs['onlyLocale'] === 1) {
92 92
             $query = $query->where('lang', '=', App::$Request->getLanguage());
93 93
         }
94 94
 
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
     public function actionShowanswers($commentId)
137 137
     {
138 138
         // check input data
139
-        if (!Obj::isLikeInt($commentId) || (int)$commentId < 1) {
139
+        if (!Obj::isLikeInt($commentId) || (int) $commentId < 1) {
140 140
             throw new JsonException('Input data is incorrect');
141 141
         }
142 142
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 
146 146
         // get data from db by comment id
147 147
         $records = CommentAnswer::where('comment_id', '=', $commentId);
148
-        if ((int)$configs['onlyLocale'] === 1) {
148
+        if ((int) $configs['onlyLocale'] === 1) {
149 149
             $records = $records->where('lang', '=', App::$Request->getLanguage());
150 150
         }
151 151
 
Please login to merge, or discard this patch.
Apps/View/Admin/default/comments/index.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/View/Admin/default/feedback/update.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-use Ffcms\Core\Helper\Date;
4 3
 use Ffcms\Core\Helper\HTML\Form;
5
-use Ffcms\Core\Helper\HTML\Table;
6 4
 use Ffcms\Core\Helper\Url;
7 5
 
8 6
 /** @var \Apps\Model\Admin\Feedback\FormUpdate $model */
Please login to merge, or discard this patch.
Apps/Controller/Admin/Feedback.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     public function actionIndex()
33 33
     {
34 34
         // set current page and offset
35
-        $page = (int)App::$Request->query->get('page');
35
+        $page = (int) App::$Request->query->get('page');
36 36
         $offset = $page * self::ITEM_PER_PAGE;
37 37
 
38 38
         // get feedback posts AR table
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
         // initialize model with answer add if thread is not closed
75 75
         $model = null;
76
-        if ((int)$record->closed !== 1) {
76
+        if ((int) $record->closed !== 1) {
77 77
             $model = new FormAnswerAdd($record, App::$User->identity()->getId());
78 78
             if ($model->send()) {
79 79
                 if ($model->validate()) {
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
             case 'answer':
105 105
                 $record = FeedbackAnswer::find($id);
106 106
                 if ($record !== null && $record !== false) {
107
-                    $postId = (int)$record->getFeedbackPost()->id;
107
+                    $postId = (int) $record->getFeedbackPost()->id;
108 108
                 }
109 109
                 break;
110 110
         }
Please login to merge, or discard this patch.
Apps/Controller/Front/Feedback.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -40,12 +40,12 @@  discard block
 block discarded – undo
40 40
     {
41 41
         // get configs
42 42
         $configs = $this->getConfigs();
43
-        if (!App::$User->isAuth() && (int)$configs['guestAdd'] !== 1) {
43
+        if (!App::$User->isAuth() && (int) $configs['guestAdd'] !== 1) {
44 44
             throw new ForbiddenException(__('Feedback available only for authorized users'));
45 45
         }
46 46
 
47 47
         // initialize model
48
-        $model = new FormFeedbackAdd((int)$configs['useCaptcha'] === 1);
48
+        $model = new FormFeedbackAdd((int) $configs['useCaptcha'] === 1);
49 49
         if ($model->send()) {
50 50
             if ($model->validate()) {
51 51
                 // if validation is passed save data to db and get row
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         // render output view
62 62
         return App::$View->render('create', [
63 63
             'model' => $model->export(),
64
-            'useCaptcha' => (int)$configs['useCaptcha'] === 1
64
+            'useCaptcha' => (int) $configs['useCaptcha'] === 1
65 65
         ]);
66 66
     }
67 67
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         $userId = App::$User->isAuth() ? App::$User->identity()->getId() : 0;
93 93
         $model = null;
94 94
         // check if feedback post is not closed for answers
95
-        if ((int)$recordPost->closed === 0) {
95
+        if ((int) $recordPost->closed === 0) {
96 96
             // init new answer add model
97 97
             $model = new FormAnswerAdd($recordPost, $userId);
98 98
             // if answer is sender lets try to make it model
@@ -127,10 +127,10 @@  discard block
 block discarded – undo
127 127
         // check if action is submited
128 128
         if (App::$Request->request->get('closeRequest', false)) {
129 129
             // if created by authorized user
130
-            if ((int)$record->user_id !== 0) {
130
+            if ((int) $record->user_id !== 0) {
131 131
                 $user = App::$User->identity();
132 132
                 // button is pressed not by request creator
133
-                if ($user === null || $user->getId() !== (int)$record->user_id) {
133
+                if ($user === null || $user->getId() !== (int) $record->user_id) {
134 134
                     throw new ForbiddenException(__('This feedback request was created by another user'));
135 135
                 }
136 136
             }
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
     public function actionList()
157 157
     {
158 158
         // set current page and offset
159
-        $page = (int)App::$Request->query->get('page');
159
+        $page = (int) App::$Request->query->get('page');
160 160
         $offset = $page * self::ITEM_PER_PAGE;
161 161
 
162 162
         // check if user is authorized or throw exception
Please login to merge, or discard this patch.
Apps/Model/Admin/Feedback/FormUpdate.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
     }
35 35
 
36 36
     /**
37
-    * Labels to display edit form
38
-    */
37
+     * Labels to display edit form
38
+     */
39 39
     public function labels()
40 40
     {
41 41
         return [
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
     }
47 47
 
48 48
     /**
49
-    * Rules to validate changes
50
-    */
49
+     * Rules to validate changes
50
+     */
51 51
     public function rules()
52 52
     {
53 53
         return [
Please login to merge, or discard this patch.
Apps/Model/Front/Feedback/FormAnswerAdd.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
     }
48 48
 
49 49
     /**
50
-    * Labels for display form
51
-    */
50
+     * Labels for display form
51
+     */
52 52
     public function labels()
53 53
     {
54 54
         return [
@@ -59,8 +59,8 @@  discard block
 block discarded – undo
59 59
     }
60 60
 
61 61
     /**
62
-    * Form validation rules
63
-    */
62
+     * Form validation rules
63
+     */
64 64
     public function rules()
65 65
     {
66 66
         return [
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
     public function __construct($recordPost, $userId = 0)
30 30
     {
31 31
         $this->_post = $recordPost;
32
-        $this->_userId = (int)$userId;
32
+        $this->_userId = (int) $userId;
33 33
         parent::__construct();
34 34
     }
35 35
 
Please login to merge, or discard this patch.
Apps/Model/Front/Feedback/FormFeedbackAdd.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 
27 27
 
28 28
     /**
29
-    * Set user data if he is logged in
30
-    */
29
+     * Set user data if he is logged in
30
+     */
31 31
     public function before()
32 32
     {
33 33
         if (App::$User->isAuth()) {
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
     }
39 39
 
40 40
     /**
41
-    * Labels to display form
42
-    */
41
+     * Labels to display form
42
+     */
43 43
     public function labels()
44 44
     {
45 45
         return [
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
     }
52 52
 
53 53
     /**
54
-    * Rules to validate send form
55
-    */
54
+     * Rules to validate send form
55
+     */
56 56
     public function rules()
57 57
     {
58 58
         $rules = [
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
 
21 21
     public function __construct($captcha = true)
22 22
     {
23
-        $this->_useCaptcha = (bool)$captcha;
23
+        $this->_useCaptcha = (bool) $captcha;
24 24
         parent::__construct();
25 25
     }
26 26
 
Please login to merge, or discard this patch.
Apps/View/Admin/default/feedback/_tabs.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,4 +9,4 @@
 block discarded – undo
9 9
         ['type' => 'link', 'text' => __('Group management'), 'link' => ['user/grouplist']],
10 10
         ['type' => 'link', 'text' => __('Settings'), 'link' => ['user/settings']]
11 11
     ]
12
-]);?>
13 12
\ No newline at end of file
13
+]); ?>
14 14
\ No newline at end of file
Please login to merge, or discard this patch.