Passed
Push — master ( ba2801...f20f2e )
by Mihail
04:42
created
Apps/Model/Front/Content/EntityCategoryList.php 2 patches
Unused Use Statements   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,9 +3,8 @@
 block discarded – undo
3 3
 namespace Apps\Model\Front\Content;
4 4
 
5 5
 
6
-use Apps\ActiveRecord\Content;
7
-use Apps\ActiveRecord\ContentCategory;
8 6
 use Apps\ActiveRecord\Content as ContentRecord;
7
+use Apps\ActiveRecord\ContentCategory;
9 8
 use Apps\ActiveRecord\User;
10 9
 use Ffcms\Core\App;
11 10
 use Ffcms\Core\Arch\Model;
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     {
54 54
         $this->_path = $path;
55 55
         $this->_configs = $configs;
56
-        $this->_page = (int)$offset;
56
+        $this->_page = (int) $offset;
57 57
         parent::__construct();
58 58
     }
59 59
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     public function before()
66 66
     {
67 67
         // find one or more categories where we must looking for content items
68
-        if ((int)$this->_configs['multiCategories'] === 1) {
68
+        if ((int) $this->_configs['multiCategories'] === 1) {
69 69
             $this->findCategories();
70 70
         } else {
71 71
             $this->findCategory();
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
     private function findCategories()
103 103
     {
104 104
         // get all categories for current path and child of it
105
-        $query = ContentCategory::where('path', 'like', $this->_path . '%');
105
+        $query = ContentCategory::where('path', 'like', $this->_path.'%');
106 106
         if ($query->count() < 1) {
107 107
             throw new NotFoundException(__('Category is not founded'));
108 108
         }
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         }
136 136
 
137 137
         // calculate selection offset
138
-        $itemPerPage = (int)$this->_configs['itemPerCategory'];
138
+        $itemPerPage = (int) $this->_configs['itemPerCategory'];
139 139
         if ($itemPerPage < 1) {
140 140
             $itemPerPage = 1;
141 141
         }
@@ -161,8 +161,8 @@  discard block
 block discarded – undo
161 161
     {
162 162
         // prepare rss url link for current category if enabled
163 163
         $rssUrl = false;
164
-        if ((int)$this->_configs['rss'] === 1) {
165
-            $rssUrl = App::$Alias->baseUrl . '/content/rss/' . $this->_currentCategory->path;
164
+        if ((int) $this->_configs['rss'] === 1) {
165
+            $rssUrl = App::$Alias->baseUrl.'/content/rss/'.$this->_currentCategory->path;
166 166
             $rssUrl = rtrim($rssUrl, '/');
167 167
         }
168 168
         
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
         ];
177 177
 
178 178
         // check if this category is hidden
179
-        if ((int)$this->category['configs']['showCategory'] !== 1) {
179
+        if ((int) $this->category['configs']['showCategory'] !== 1) {
180 180
             throw new ForbiddenException(__('This category is not available to view'));
181 181
         }
182 182
 
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
             // check if current user can rate item
223 223
             $ignoredRate = App::$Session->get('content.rate.ignore');
224 224
             $canRate = true;
225
-            if (Obj::isArray($ignoredRate) && Arr::in((string)$row->id, $ignoredRate)) {
225
+            if (Obj::isArray($ignoredRate) && Arr::in((string) $row->id, $ignoredRate)) {
226 226
                 $canRate = false;
227 227
             }
228 228
             if (!App::$User->isAuth()) {
@@ -239,11 +239,11 @@  discard block
 block discarded – undo
239 239
                 'poster' => $row->getPosterUri(),
240 240
                 'thumb' => $row->getPosterThumbUri(),
241 241
                 'thumbSize' => File::size($row->getPosterThumbUri()),
242
-                'views' => (int)$row->views,
243
-                'rating' => (int)$row->rating,
242
+                'views' => (int) $row->views,
243
+                'rating' => (int) $row->rating,
244 244
                 'canRate' => $canRate,
245 245
                 'category' => $this->categories[$row->category_id],
246
-                'uri' => '/content/read/' . $itemPath,
246
+                'uri' => '/content/read/'.$itemPath,
247 247
                 'tags' => $tags
248 248
             ];
249 249
         }
Please login to merge, or discard this patch.
Apps/Model/Front/Content/EntityContentSearch.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
      * EntityContentSearch constructor. Pass search terms (query string) to model and used items to skip it by id.
27 27
      * @param $terms
28
-     * @param int|array $skipIds
28
+     * @param integer $skipIds
29 29
      */
30 30
     public function __construct($terms, $skipIds = 0)
31 31
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
             $this->items[] = [
78 78
                 'title' => $item->getLocaled('title'),
79 79
                 'snippet' => Text::snippet($text),
80
-                'uri' => '/content/read/' . $item->getPath(),
80
+                'uri' => '/content/read/'.$item->getPath(),
81 81
                 'thumb' => $item->getPosterThumbUri()
82 82
             ];
83 83
         }
Please login to merge, or discard this patch.
Private/Config/Routing.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php return [
2
-	'Alias' => [
3
-		'Front' => [
4
-			'/about' => '/content/read/page/about-page'
5
-		]
6
-	],
7
-	'Callback' => [
8
-		'Front' => [
9
-			'Demo' => '\Apps\Controller\Front\Main'
10
-		]
11
-	]
2
+    'Alias' => [
3
+        'Front' => [
4
+            '/about' => '/content/read/page/about-page'
5
+        ]
6
+    ],
7
+    'Callback' => [
8
+        'Front' => [
9
+            'Demo' => '\Apps\Controller\Front\Main'
10
+        ]
11
+    ]
12 12
 ];
13 13
\ No newline at end of file
Please login to merge, or discard this patch.
Apps/Model/Admin/Comments/FormSettings.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
     }
43 43
 
44 44
     /**
45
-    * Labels for form
46
-    */
45
+     * Labels for form
46
+     */
47 47
     public function labels()
48 48
     {
49 49
         return [
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
     }
58 58
 
59 59
     /**
60
-    * Validation rules for comments settings
61
-    */
60
+     * Validation rules for comments settings
61
+     */
62 62
     public function rules()
63 63
     {
64 64
         return [
Please login to merge, or discard this patch.
Apps/Model/Api/Comments/CommentPostAdd.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     public function check()
57 57
     {
58 58
         // check if user is auth'd or guest name is defined
59
-        if (!App::$User->isAuth() && ((int)$this->_configs['guestAdd'] !== 1 || Str::length($this->guestName) < 2)) {
59
+        if (!App::$User->isAuth() && ((int) $this->_configs['guestAdd'] !== 1 || Str::length($this->guestName) < 2)) {
60 60
             throw new JsonException(__('Guest name is not defined'));
61 61
         }
62 62
 
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
         }
67 67
 
68 68
         // check if message length is correct
69
-        if (Str::length($this->message) < (int)$this->_configs['minLength'] || Str::length($this->message) > (int)$this->_configs['maxLength']) {
69
+        if (Str::length($this->message) < (int) $this->_configs['minLength'] || Str::length($this->message) > (int) $this->_configs['maxLength']) {
70 70
             throw new JsonException(__('Message length is incorrect. Current: %cur% , min - %min%, max - %max%', [
71 71
                 'cur' => Str::length($this->message),
72 72
                 'min' => $this->_configs['minLength'],
Please login to merge, or discard this patch.
Apps/Model/Api/Comments/CommentAnswerAdd.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     public function check()
57 57
     {
58 58
         // check if user is auth'd or guest name is defined
59
-        if (!App::$User->isAuth() && ((int)$this->_configs['guestAdd'] !== 1 || Str::length($this->guestName) < 2)) {
59
+        if (!App::$User->isAuth() && ((int) $this->_configs['guestAdd'] !== 1 || Str::length($this->guestName) < 2)) {
60 60
             throw new JsonException(__('Guest name is not defined'));
61 61
         }
62 62
 
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
         }
67 67
 
68 68
         // check if message length is correct
69
-        if (Str::length($this->message) < (int)$this->_configs['minLength'] || Str::length($this->message) > (int)$this->_configs['maxLength']) {
69
+        if (Str::length($this->message) < (int) $this->_configs['minLength'] || Str::length($this->message) > (int) $this->_configs['maxLength']) {
70 70
             throw new JsonException(__('Message length is incorrect. Current: %cur% , min - %min%, max - %max%', [
71 71
                 'cur' => Str::length($this->message),
72 72
                 'min' => $this->_configs['minLength'],
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/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.