Passed
Push — master ( cc7747...d2190f )
by Mihail
10:36
created
Apps/Controller/Admin/Content.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,6 @@
 block discarded – undo
19 19
 use Ffcms\Core\Exception\NativeException;
20 20
 use Ffcms\Core\Exception\NotFoundException;
21 21
 use Ffcms\Core\Exception\SyntaxException;
22
-use Ffcms\Core\Helper\FileSystem\Directory;
23 22
 use Ffcms\Core\Helper\HTML\SimplePagination;
24 23
 use Ffcms\Core\Helper\Type\Obj;
25 24
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
     public function actionIndex()
44 44
     {
45 45
         // set current page and offset
46
-        $page = (int)$this->request->query->get('page');
46
+        $page = (int) $this->request->query->get('page');
47 47
         $offset = $page * self::ITEM_PER_PAGE;
48 48
 
49 49
         $query = null;
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         } elseif ($type === 'moderate') { // only items on moderate
55 55
             $query = ContentEntity::where('display', '=', 0);
56 56
         } elseif (Obj::isLikeInt($type)) { // sounds like category id ;)
57
-            $query = ContentEntity::where('category_id', '=', (int)$type);
57
+            $query = ContentEntity::where('category_id', '=', (int) $type);
58 58
         } else {
59 59
             $query = new ContentEntity();
60 60
             $type = 'all';
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
     public function actionCategoryupdate($id = null)
269 269
     {
270 270
         // get owner id for new rows
271
-        $parentId = (int)$this->request->query->get('parent');
271
+        $parentId = (int) $this->request->query->get('parent');
272 272
 
273 273
         // get relation and pass to model
274 274
         $record = ContentCategory::findOrNew($id);
Please login to merge, or discard this patch.
Apps/Controller/Admin/Main.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -13,8 +13,6 @@
 block discarded – undo
13 13
 use Ffcms\Core\Helper\Environment;
14 14
 use Ffcms\Core\Helper\FileSystem\Directory;
15 15
 use Ffcms\Core\Helper\FileSystem\File;
16
-use Ffcms\Core\Helper\Type\Arr;
17
-use Ffcms\Core\Helper\Type\Integer;
18 16
 use Ffcms\Core\Helper\Type\Str;
19 17
 use Symfony\Component\HttpFoundation\Cookie;
20 18
 
Please login to merge, or discard this patch.
Apps/Model/Admin/Comments/FormCommentUpdate.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
 
20 20
     /**
21 21
      * FormCommentUpdate constructor. Pass record inside the model.
22
-     * @param \Apps\ActiveRecord\CommentPost|\Apps\ActiveRecord\CommentAnswer $record
22
+     * @param \Ffcms\Core\Arch\ActiveModel $record
23 23
      */
24 24
     public function __construct($record, $type = 'comment')
25 25
     {
Please login to merge, or discard this patch.
Apps/Controller/Admin/Contenttag.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
         
36 36
         // render view output
37 37
         return $this->view->render('index', [
38
-           'model' => $model
38
+            'model' => $model
39 39
         ]);
40 40
     }
41 41
 }
42 42
\ No newline at end of file
Please login to merge, or discard this patch.
Apps/Controller/Admin/Widget.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         $search = \Apps\ActiveRecord\App::getItem('widget', $controller);
88 88
 
89 89
         // check what we got
90
-        if ($search === null || (int)$search->id < 1) {
90
+        if ($search === null || (int) $search->id < 1) {
91 91
             throw new NotFoundException('Widget is not founded');
92 92
         }
93 93
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
         $record = \Apps\ActiveRecord\App::where('sys_name', '=', $controllerName)->where('type', '=', 'widget')->first();
122 122
 
123 123
         // check if widget admin controller exists
124
-        if ($record === null || (int)$record->id < 1) {
124
+        if ($record === null || (int) $record->id < 1) {
125 125
             throw new ForbiddenException('Widget is not founded');
126 126
         }
127 127
 
Please login to merge, or discard this patch.
Apps/Model/Admin/Feedback/FormAnswerAdd.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -37,9 +37,9 @@
 block discarded – undo
37 37
         $record->save();
38 38
 
39 39
         // add user notification
40
-        if ((int)$this->_post->user_id > 0 && $this->_userId !== (int)$this->_post->user_id) {
41
-            $notify = new EntityAddNotification((int)$this->_post->user_id);
42
-            $uri = '/feedback/read/' . $this->_post->id . '/' . $this->_post->hash . '#feedback-answer-' . $record->id;
40
+        if ((int) $this->_post->user_id > 0 && $this->_userId !== (int) $this->_post->user_id) {
41
+            $notify = new EntityAddNotification((int) $this->_post->user_id);
42
+            $uri = '/feedback/read/'.$this->_post->id.'/'.$this->_post->hash.'#feedback-answer-'.$record->id;
43 43
 
44 44
             $notify->add($uri, EntityAddNotification::MSG_ADD_FEEDBACKANSWER, [
45 45
                 'snippet' => Text::snippet($this->message, 50),
Please login to merge, or discard this patch.
Apps/Model/Admin/Application/FormTurn.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
     {
31 31
         $status = $this->_record->disabled;
32 32
 
33
-        $this->_record->disabled = (int)!$status; // magic inside: bool to int and reverse - 0 => 1, 1 => 0
33
+        $this->_record->disabled = (int) !$status; // magic inside: bool to int and reverse - 0 => 1, 1 => 0
34 34
         $this->_record->save();
35 35
     }
36 36
 }
37 37
\ No newline at end of file
Please login to merge, or discard this patch.
Apps/Model/Admin/User/FormUserSettings.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,8 +27,8 @@
 block discarded – undo
27 27
     }
28 28
 
29 29
     /**
30
-    * Load configs from app data
31
-    */
30
+     * Load configs from app data
31
+     */
32 32
     public function before()
33 33
     {
34 34
         if ($this->_config === null) {
Please login to merge, or discard this patch.
Apps/Model/Admin/Content/FormContentUpdate.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         if ($this->_content->id === null) {
60 60
             $this->_new = true;
61 61
             if (null === $this->galleryFreeId) {
62
-                $this->galleryFreeId = '_tmp_' . Str::randomLatin(mt_rand(16, 32));
62
+                $this->galleryFreeId = '_tmp_'.Str::randomLatin(mt_rand(16, 32));
63 63
             }
64 64
             if (null === $this->authorId) {
65 65
                 $this->authorId = App::$User->identity()->getId();
@@ -91,8 +91,8 @@  discard block
 block discarded – undo
91 91
     public function rules()
92 92
     {
93 93
         $res = [
94
-            ['title.' . App::$Request->getLanguage(), 'required'],
95
-            ['text.' . App::$Request->getLanguage(), 'required'],
94
+            ['title.'.App::$Request->getLanguage(), 'required'],
95
+            ['text.'.App::$Request->getLanguage(), 'required'],
96 96
             ['text', 'used'],
97 97
             ['path', 'reverse_match', '/[\/\'~`\!@#\$%\^&\*\(\)+=\{\}\[\]\|;:"\<\>,\?\\\]/'],
98 98
             [['path', 'categoryId', 'authorId', 'display', 'galleryFreeId', 'title'], 'required'],
@@ -105,9 +105,9 @@  discard block
 block discarded – undo
105 105
         ];
106 106
 
107 107
         foreach (App::$Properties->get('languages') as $lang) {
108
-            $res[] = ['title.' . $lang, 'length_max', 120, null, true, true];
109
-            $res[] = ['keywords.' . $lang, 'length_max', 150];
110
-            $res[] = ['description.' . $lang, 'length_max', 250];
108
+            $res[] = ['title.'.$lang, 'length_max', 120, null, true, true];
109
+            $res[] = ['keywords.'.$lang, 'length_max', 150];
110
+            $res[] = ['description.'.$lang, 'length_max', 250];
111 111
         }
112 112
 
113 113
         return $res;
@@ -163,8 +163,8 @@  discard block
 block discarded – undo
163 163
         $this->_content->meta_description = Serialize::encode($this->metaDescription);
164 164
         $this->_content->source = $this->source;
165 165
         // check if rating is changed
166
-        if ((int)$this->addRating !== 0) {
167
-            $this->_content->rating += (int)$this->addRating;
166
+        if ((int) $this->addRating !== 0) {
167
+            $this->_content->rating += (int) $this->addRating;
168 168
         }
169 169
         // check if special comment hash is exist
170 170
         if ($this->_new || Str::length($this->_content->comment_hash) < 32) {
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
         }
177 177
 
178 178
         // save poster data
179
-        $posterPath = '/upload/gallery/' . $this->galleryFreeId . '/orig/' . $this->poster;
179
+        $posterPath = '/upload/gallery/'.$this->galleryFreeId.'/orig/'.$this->poster;
180 180
         if (File::exist($posterPath)) {
181 181
             $this->_content->poster = $this->poster;
182 182
         }
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 
212 212
         // move files
213 213
         if ($tmpGalleryId !== $this->_content->id) {
214
-            Directory::rename('/upload/gallery/' . $tmpGalleryId, $this->_content->id);
214
+            Directory::rename('/upload/gallery/'.$tmpGalleryId, $this->_content->id);
215 215
         }
216 216
     }
217 217
 
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
         $data = ContentCategory::getSortedCategories();
225 225
         $response = [];
226 226
         foreach ($data as $key=>$val) {
227
-            $response[] = (string)$key;
227
+            $response[] = (string) $key;
228 228
         }
229 229
         return $response;
230 230
     }
Please login to merge, or discard this patch.