Passed
Branch master (25273e)
by Mihail
04:42
created
Apps/ActiveRecord/Role.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,6 @@
 block discarded – undo
5 5
 use Ffcms\Core\App as MainApp;
6 6
 use Ffcms\Core\Arch\ActiveModel;
7 7
 use Ffcms\Core\Helper\Type\Arr;
8
-use Ffcms\Core\Helper\Type\Str;
9 8
 
10 9
 class Role extends ActiveModel
11 10
 {
Please login to merge, or discard this patch.
Apps/Controller/Admin/Main.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,6 @@
 block discarded – undo
9 9
 use Ffcms\Core\App;
10 10
 use Ffcms\Core\Exception\SyntaxException;
11 11
 use Ffcms\Core\Helper\FileSystem\File;
12
-use Ffcms\Core\Helper\Type\Arr;
13 12
 use Ffcms\Core\Helper\Type\Integer;
14 13
 use Ffcms\Core\Helper\Type\Str;
15 14
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -32,13 +32,13 @@  discard block
 block discarded – undo
32 32
         // cache some data
33 33
         $rootSize = App::$Cache->get('root.size');
34 34
         if ($rootSize === null) {
35
-            $rootSize = round(Directory::getSize('/') / (1024*1000), 2) . ' mb';
35
+            $rootSize = round(Directory::getSize('/') / (1024 * 1000), 2) . ' mb';
36 36
             App::$Cache->set('root.size', $rootSize, 60 * 60 * 24); // 24 hours caching
37 37
         }
38 38
         $loadAvg = App::$Cache->get('load.average');
39 39
         if ($loadAvg === null) {
40 40
             $loadAvg = Environment::loadAverage();
41
-            App::$Cache->set('load.average', $loadAvg, 60*5); // 5 min cache
41
+            App::$Cache->set('load.average', $loadAvg, 60 * 5); // 5 min cache
42 42
         }
43 43
 
44 44
         $stats = [
@@ -145,9 +145,9 @@  discard block
 block discarded – undo
145 145
      */
146 146
     public function actionDeleteroute()
147 147
     {
148
-        $type = (string)App::$Request->query->get('type');
149
-        $loader = (string)App::$Request->query->get('loader');
150
-        $source = Str::lowerCase((string)App::$Request->query->get('path'));
148
+        $type = (string) App::$Request->query->get('type');
149
+        $loader = (string) App::$Request->query->get('loader');
150
+        $source = Str::lowerCase((string) App::$Request->query->get('path'));
151 151
 
152 152
         $model = new EntityDeleteRoute($type, $loader, $source);
153 153
         if ($model->send()) {
Please login to merge, or discard this patch.
Apps/Controller/Front/Main.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use Extend\Core\Arch\FrontAppController;
6 6
 use Ffcms\Core\Arch\View;
7
-use Apps\Model\Front\User;
8 7
 
9 8
 
10 9
 class Main extends FrontAppController
Please login to merge, or discard this patch.
Apps/Model/Admin/Content/FormContentUpdate.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,6 @@
 block discarded – undo
9 9
 use Ffcms\Core\Helper\Date;
10 10
 use Ffcms\Core\Helper\FileSystem\Directory;
11 11
 use Ffcms\Core\Helper\FileSystem\File;
12
-use Ffcms\Core\Helper\Type\Integer;
13 12
 use Ffcms\Core\Helper\Type\Obj;
14 13
 use Ffcms\Core\Helper\Serialize;
15 14
 use Ffcms\Core\Helper\Type\Str;
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
      */
82 82
     public function rules()
83 83
     {
84
-        $res =  [
84
+        $res = [
85 85
             ['title.' . App::$Request->getLanguage(), 'required'],
86 86
             ['text.' . App::$Request->getLanguage(), 'required', null, true, true],
87 87
             ['text', 'used', null, true, true],
@@ -142,8 +142,8 @@  discard block
 block discarded – undo
142 142
         $this->_content->meta_description = Serialize::encode(App::$Security->strip_tags($this->metaDescription));
143 143
         $this->_content->source = App::$Security->strip_tags($this->source);
144 144
         // check if rating is changed
145
-        if ((int)$this->addRating !== 0) {
146
-            $this->_content->rating += (int)$this->addRating;
145
+        if ((int) $this->addRating !== 0) {
146
+            $this->_content->rating += (int) $this->addRating;
147 147
         }
148 148
         // check if special comment hash is exist
149 149
         if ($this->_new || Str::length($this->_content->comment_hash) < 32) {
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
         $data = ContentCategory::getSortedCategories();
182 182
         $response = [];
183 183
         foreach ($data as $key=>$val) {
184
-            $response[] = (string)$key;
184
+            $response[] = (string) $key;
185 185
         }
186 186
         return $response;
187 187
     }
Please login to merge, or discard this patch.
Apps/Model/Front/Profile/FormWallPost.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 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\Interfaces\iUser;
Please login to merge, or discard this patch.
Apps/Model/Front/User/FormLogin.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use Ffcms\Core\App;
6 6
 use Ffcms\Core\Arch\Model;
7
-use Ffcms\Core\Helper\Type\Obj;
8 7
 use Ffcms\Core\Helper\Type\Str;
9 8
 use Ffcms\Core\Interfaces\iUser;
10 9
 
Please login to merge, or discard this patch.
Apps/ActiveRecord/ContentCategory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
             } else {
72 72
                 // set level marker based on slashes count in pathway
73 73
                 $slashCount = Str::entryCount($path, '/');
74
-                for ($i=-1; $i <= $slashCount; $i++) {
74
+                for ($i = -1; $i <= $slashCount; $i++) {
75 75
                     $title .= '--';
76 76
                 }
77 77
             }
Please login to merge, or discard this patch.
Apps/ActiveRecord/User.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
         }
24 24
 
25 25
         // convert id to real integer
26
-        $user_id = (int)$user_id;
26
+        $user_id = (int) $user_id;
27 27
 
28 28
         if (!Obj::isInt($user_id) || $user_id < 1) {
29 29
             return null;
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
      */
52 52
     public function getId()
53 53
     {
54
-        return (int)$this->id;
54
+        return (int) $this->id;
55 55
     }
56 56
 
57 57
     /**
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     {
74 74
         // get data from session
75 75
         $session_token = MainApp::$Session->get('ff_user_token', null);
76
-        $session_id = (int)MainApp::$Session->get('ff_user_id', 0);
76
+        $session_id = (int) MainApp::$Session->get('ff_user_id', 0);
77 77
 
78 78
         // validate session data
79 79
         if (null === $session_token || $session_id < 1 || Str::length($session_token) < 64) {
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         }
108 108
 
109 109
         // convert id to real integer
110
-        $id = (int)$id;
110
+        $id = (int) $id;
111 111
 
112 112
         $find = MainApp::$Memory->get('user.counter.cache.' . $id);
113 113
         if ($find === null) {
Please login to merge, or discard this patch.
Apps/Controller/Admin/Content.php 2 patches
Spacing   +4 added lines, -4 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
         $query = null;
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         if ($type === 'trash') {
42 42
             $query = ContentEntity::onlyTrashed();
43 43
         } elseif (Obj::isLikeInt($type)) { // sounds like category id ;)
44
-            $query = ContentEntity::where('category_id', '=', (int)$type);
44
+            $query = ContentEntity::where('category_id', '=', (int) $type);
45 45
         } else {
46 46
             $query = new ContentEntity();
47 47
             $type = 'all';
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
         if ($model->send() && $model->validate()) {
184 184
             // remove all trashed items
185 185
             foreach ($records->get() as $item) {
186
-                $galleryPath = '/upload/gallery/' . (int)$item->id;
186
+                $galleryPath = '/upload/gallery/' . (int) $item->id;
187 187
                 if (Directory::exist($galleryPath)) {
188 188
                     Directory::remove($galleryPath);
189 189
                 }
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
     public function actionCategoryupdate($id = null)
254 254
     {
255 255
         // get owner id for new rows
256
-        $parentId = (int)App::$Request->query->get('parent');
256
+        $parentId = (int) App::$Request->query->get('parent');
257 257
 
258 258
         // get relation and pass to model
259 259
         $record = ContentCategory::findOrNew($id);
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,6 @@
 block discarded – undo
9 9
 use Ffcms\Core\App;
10 10
 use Ffcms\Core\Exception\SyntaxException;
11 11
 use Ffcms\Core\Helper\FileSystem\File;
12
-use Ffcms\Core\Helper\Type\Arr;
13 12
 use Ffcms\Core\Helper\Type\Integer;
14 13
 use Ffcms\Core\Helper\Type\Str;
15 14
 
Please login to merge, or discard this patch.