Passed
Push — master ( fa3542...0a3787 )
by Mihail
05:11
created
Apps/Model/Admin/Content/FormContentUpdate.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         if (!$this->_content->id) {
65 65
             $this->_new = true;
66 66
             if (!$this->galleryFreeId) {
67
-                $this->galleryFreeId = '_tmp_' . Str::randomLatin(mt_rand(16, 32));
67
+                $this->galleryFreeId = '_tmp_'.Str::randomLatin(mt_rand(16, 32));
68 68
             }
69 69
 
70 70
             if (!$this->authorId) {
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
                 $this->categoryId = 1;
76 76
             }
77 77
             if (!$this->path) {
78
-                $this->path = Integer::random(8) . '-' . date('d-m-Y');
78
+                $this->path = Integer::random(8).'-'.date('d-m-Y');
79 79
             }
80 80
 
81 81
             if ($this->cloneId > 0) {
@@ -113,8 +113,8 @@  discard block
 block discarded – undo
113 113
     public function rules(): array
114 114
     {
115 115
         $res = [
116
-            ['title.' . App::$Request->getLanguage(), 'required'],
117
-            ['text.' . App::$Request->getLanguage(), 'required'],
116
+            ['title.'.App::$Request->getLanguage(), 'required'],
117
+            ['text.'.App::$Request->getLanguage(), 'required'],
118 118
             ['text', 'used'],
119 119
             ['path', 'reverse_match', '/[\/\'~`\!@#\$%\^&\*\(\)+=\{\}\[\]\|;:"\<\>,\?\\\]/'],
120 120
             [['path', 'categoryId', 'authorId', 'display', 'galleryFreeId', 'title', 'important'], 'required'],
@@ -127,9 +127,9 @@  discard block
 block discarded – undo
127 127
         ];
128 128
 
129 129
         foreach (App::$Properties->get('languages') as $lang) {
130
-            $res[] = ['title.' . $lang, 'length_max', 120, null, true, true];
131
-            $res[] = ['keywords.' . $lang, 'length_max', 150];
132
-            $res[] = ['description.' . $lang, 'length_max', 250];
130
+            $res[] = ['title.'.$lang, 'length_max', 120, null, true, true];
131
+            $res[] = ['keywords.'.$lang, 'length_max', 150];
132
+            $res[] = ['description.'.$lang, 'length_max', 250];
133 133
         }
134 134
 
135 135
         return $res;
@@ -185,10 +185,10 @@  discard block
 block discarded – undo
185 185
         $this->_content->meta_keywords = $this->metaKeywords;
186 186
         $this->_content->meta_description = $this->metaDescription;
187 187
         $this->_content->source = $this->source;
188
-        $this->_content->important = (int)$this->important;
188
+        $this->_content->important = (int) $this->important;
189 189
         // check if rating is changed
190
-        if ((int)$this->addRating !== 0) {
191
-            $this->_content->rating += (int)$this->addRating;
190
+        if ((int) $this->addRating !== 0) {
191
+            $this->_content->rating += (int) $this->addRating;
192 192
         }
193 193
         // check if special comment hash is exist
194 194
         if ($this->_new || Str::length($this->_content->comment_hash) < 32) {
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
         }
202 202
 
203 203
         // save poster data
204
-        $posterPath = '/upload/gallery/' . $this->galleryFreeId . '/orig/' . $this->poster;
204
+        $posterPath = '/upload/gallery/'.$this->galleryFreeId.'/orig/'.$this->poster;
205 205
         if (File::exist($posterPath)) {
206 206
             $this->_content->poster = $this->poster;
207 207
         }
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 
237 237
         // move files
238 238
         if ($tmpGalleryId !== $this->_content->id) {
239
-            Directory::rename('/upload/gallery/' . $tmpGalleryId, $this->_content->id);
239
+            Directory::rename('/upload/gallery/'.$tmpGalleryId, $this->_content->id);
240 240
         }
241 241
     }
242 242
 
Please login to merge, or discard this patch.