Passed
Push — master ( f2c1fd...66552f )
by Mihail
04:43
created
Apps/ActiveRecord/Role.php 2 patches
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.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,12 +26,12 @@
 block discarded – undo
26 26
      */
27 27
     public static function get($role_id)
28 28
     {
29
-        $role = MainApp::$Memory->get('user.role.cache.' . $role_id);
29
+        $role = MainApp::$Memory->get('user.role.cache.'.$role_id);
30 30
 
31 31
         // not founded in cache
32 32
         if ($role === null) {
33 33
             $role = self::find($role_id);
34
-            MainApp::$Memory->set('user.role.cache.' . $role_id, $role);
34
+            MainApp::$Memory->set('user.role.cache.'.$role_id, $role);
35 35
         }
36 36
         return $role;
37 37
     }
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   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -32,20 +32,20 @@  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 = [
45
-            'ff_version' => App::$Properties->version['num'] . ' (' . App::$Properties->version['date'] . ')',
46
-            'php_version' => Environment::phpVersion() . ' (' . Environment::phpSAPI() . ')',
45
+            'ff_version' => App::$Properties->version['num'].' ('.App::$Properties->version['date'].')',
46
+            'php_version' => Environment::phpVersion().' ('.Environment::phpSAPI().')',
47 47
             'os_name' => Environment::osName(),
48
-            'database_name' => App::$Database->connection()->getDatabaseName() . ' (' . App::$Database->connection()->getDriverName() . ')',
48
+            'database_name' => App::$Database->connection()->getDatabaseName().' ('.App::$Database->connection()->getDriverName().')',
49 49
             'file_size' => $rootSize,
50 50
             'load_avg' => $loadAvg
51 51
         ];
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     public function actionFiles()
87 87
     {
88 88
         return App::$View->render('files', [
89
-            'connector' => App::$Alias->scriptUrl . '/api/main/files?lang=' . App::$Request->getLanguage()
89
+            'connector' => App::$Alias->scriptUrl.'/api/main/files?lang='.App::$Request->getLanguage()
90 90
         ]);
91 91
     }
92 92
 
@@ -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 2 patches
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.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,6 +25,6 @@
 block discarded – undo
25 25
 
26 26
     public function actionRead($id)
27 27
     {
28
-        echo "Action read called" . $id;
28
+        echo "Action read called".$id;
29 29
     }
30 30
 }
31 31
\ No newline at end of file
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   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         if ($this->_content->id === null) {
52 52
             $this->_new = true;
53 53
             if (null === $this->galleryFreeId) {
54
-                $this->galleryFreeId = '_tmp_' . Str::randomLatin(mt_rand(16, 32));
54
+                $this->galleryFreeId = '_tmp_'.Str::randomLatin(mt_rand(16, 32));
55 55
             }
56 56
             if (null === $this->authorId) {
57 57
                 $this->authorId = App::$User->identity()->getId();
@@ -81,9 +81,9 @@  discard block
 block discarded – undo
81 81
      */
82 82
     public function rules()
83 83
     {
84
-        $res =  [
85
-            ['title.' . App::$Request->getLanguage(), 'required'],
86
-            ['text.' . App::$Request->getLanguage(), 'required', null, true, true],
84
+        $res = [
85
+            ['title.'.App::$Request->getLanguage(), 'required'],
86
+            ['text.'.App::$Request->getLanguage(), 'required', null, true, true],
87 87
             ['text', 'used', null, true, true],
88 88
             ['path', 'reverse_match', '/[\/\'~`\!@#\$%\^&\*\(\)+=\{\}\[\]\|;:"\<\>,\?\\\]/'],
89 89
             [['path', 'categoryId', 'authorId', 'display', 'galleryFreeId', 'title'], 'required'],
@@ -96,9 +96,9 @@  discard block
 block discarded – undo
96 96
         ];
97 97
 
98 98
         foreach (App::$Properties->get('languages') as $lang) {
99
-            $res[] = ['title.' . $lang, 'length_max', 120, null, true, true];
100
-            $res[] = ['keywords.' . $lang, 'length_max', 150];
101
-            $res[] = ['description.' . $lang, 'length_max', 250];
99
+            $res[] = ['title.'.$lang, 'length_max', 120, null, true, true];
100
+            $res[] = ['keywords.'.$lang, 'length_max', 150];
101
+            $res[] = ['description.'.$lang, 'length_max', 250];
102 102
         }
103 103
 
104 104
         return $res;
@@ -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) {
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
         }
156 156
 
157 157
         // save poster data
158
-        $posterPath = '/upload/gallery/' . $this->galleryFreeId . '/orig/' . $this->poster;
158
+        $posterPath = '/upload/gallery/'.$this->galleryFreeId.'/orig/'.$this->poster;
159 159
         if (File::exist($posterPath)) {
160 160
             $this->_content->poster = $this->poster;
161 161
         }
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 
169 169
         // move files
170 170
         if ($tmpGalleryId !== $this->_content->id) {
171
-            Directory::rename('/upload/gallery/' . $tmpGalleryId, $this->_content->id);
171
+            Directory::rename('/upload/gallery/'.$tmpGalleryId, $this->_content->id);
172 172
         }
173 173
     }
174 174
 
@@ -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/Controller/Admin/User.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
         $query = new UserRecords();
27 27
 
28 28
         // set current page and offset
29
-        $page = (int)App::$Request->query->get('page');
29
+        $page = (int) App::$Request->query->get('page');
30 30
         $offset = $page * self::ITEM_PER_PAGE;
31 31
 
32 32
         // build pagination
Please login to merge, or discard this patch.
Apps/Model/Admin/User/FormUserUpdate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@
 block discarded – undo
98 98
                 if ($this->newpassword !== null && Str::length($this->newpassword) >= 3) {
99 99
                     $this->_user->password = App::$Security->password_hash($this->newpassword);
100 100
                 }
101
-            } elseif($property === 'approve_token') {
101
+            } elseif ($property === 'approve_token') {
102 102
                 if ($value == "1") {
103 103
                     $this->_user->approve_token = '0';
104 104
                 } else {
Please login to merge, or discard this patch.
Apps/Model/Front/Profile/FormIgnoreAdd.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
     public function save()
53 53
     {
54 54
         // check if target is myself or always exist in block list
55
-        if ($this->_user->getId() === (int)$this->id || Blacklist::have($this->_user->getId(), $this->id)) {
55
+        if ($this->_user->getId() === (int) $this->id || Blacklist::have($this->_user->getId(), $this->id)) {
56 56
             return false;
57 57
         }
58 58
 
Please login to merge, or discard this patch.
Apps/View/Admin/default/application/turn.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
             [['text' => __('Name')], ['text' => $app->getLocaleName()]],
32 32
             [['text' => __('System name')], ['text' => $app->sys_name]],
33 33
             [['text' => __('Last update')], ['text' => Date::convertToDatetime($app->updated_at, DATE::FORMAT_TO_SECONDS)]],
34
-            [['text' => __('Status')], ['text' => ((int)$app->disabled === 0) ? 'On' : 'Off'], 'property' => ['class' =>  ((int)$app->disabled === 0) ? 'alert-success' : 'alert-danger']]
34
+            [['text' => __('Status')], ['text' => ((int) $app->disabled === 0) ? 'On' : 'Off'], 'property' => ['class' =>  ((int) $app->disabled === 0) ? 'alert-success' : 'alert-danger']]
35 35
         ]
36 36
     ]
37 37
 ]); ?>
Please login to merge, or discard this patch.