Passed
Push — master ( 10220a...9ad793 )
by Mihail
05:11
created
Apps/Model/Admin/Main/FormAddRoute.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
         $configData = [
59 59
             ucfirst(Str::lowerCase($this->type)) => [
60 60
                 ucfirst(Str::lowerCase($this->loader)) => [
61
-                    '/' . trim($this->source, '/') => '/' . trim($this->target, '/')
61
+                    '/'.trim($this->source, '/') => '/'.trim($this->target, '/')
62 62
                 ]
63 63
             ]
64 64
         ];
Please login to merge, or discard this patch.
Apps/Model/Admin/Main/EntityDeleteRoute.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
 
49 49
         // prepare source path
50 50
         if ($this->type === 'Alias') {
51
-            $this->source = '/' . trim($this->source, '/');
51
+            $this->source = '/'.trim($this->source, '/');
52 52
         } else {
53 53
             $this->source = ucfirst($this->source);
54 54
         }
Please login to merge, or discard this patch.
Apps/Model/Admin/Content/FormCategoryDelete.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         }
76 76
 
77 77
         // get all depended category ids
78
-        $cats = ContentCategory::where('path', 'like', $this->_record->path . '%')->get(['id'])->toArray();
78
+        $cats = ContentCategory::where('path', 'like', $this->_record->path.'%')->get(['id'])->toArray();
79 79
         $allCategoryIds = Arr::ploke('id', $cats);
80 80
 
81 81
         // update category_id in content
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
         $response = [];
111 111
         foreach ($data as $key=>$val) {
112 112
             if ($this->_record->id !== $key) {
113
-                $response[] = (string)$key;
113
+                $response[] = (string) $key;
114 114
             }
115 115
         }
116 116
         return $response;
Please login to merge, or discard this patch.
Apps/Model/Admin/Content/FormContentUpdate.php 1 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/Admin/Content/FormCategoryUpdate.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         ];
108 108
 
109 109
         // general category
110
-        if ($this->_new === false && (int)$this->_record->id === 1) {
110
+        if ($this->_new === false && (int) $this->_record->id === 1) {
111 111
             $rules[] = ['path', 'used'];
112 112
         } else {
113 113
             $rules[] = ['path', 'required'];
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
             $rules[] = ['path', 'reverse_match', '/[\/\'~`\!@#\$%\^&\*\(\)+=\{\}\[\]\|;:"\<\>,\?\\\]/'];
117 117
         }
118 118
 
119
-        $rules[] = ['title.' . App::$Request->getLanguage(), 'required'];
119
+        $rules[] = ['title.'.App::$Request->getLanguage(), 'required'];
120 120
 
121 121
 
122 122
         return $rules;
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
     {
130 130
         $this->_record->title = Serialize::encode(App::$Security->strip_tags($this->title));
131 131
         $this->_record->description = Serialize::encode(App::$Security->strip_tags($this->description));
132
-        $savePath = trim($this->_pathNested . '/' . $this->path, '/');
132
+        $savePath = trim($this->_pathNested.'/'.$this->path, '/');
133 133
         $this->_record->path = $savePath;
134 134
         $this->_record->configs = Serialize::encode($this->configs);
135 135
         $this->_record->save();
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
         // build path with owner category
165 165
         $this->_pathNested = $owner->path;
166 166
         if (Str::length($this->_pathNested) > 0) {
167
-            $path = $this->_pathNested . '/' . $path;
167
+            $path = $this->_pathNested.'/'.$path;
168 168
         }
169 169
 
170 170
         // make select for check
Please login to merge, or discard this patch.
Apps/Model/Front/Profile/FormSettings.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     */
57 57
     public function labels()
58 58
     {
59
-        $labels =  [
59
+        $labels = [
60 60
             'nick' => __('Nickname'),
61 61
             'sex' => __('Sex'),
62 62
             'birthday' => __('Birthday'),
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 
69 69
         // labels for custom fields
70 70
         foreach (ProfileField::getAll() as $custom) {
71
-            $labels['custom_data.' . $custom->id] = Serialize::getDecodeLocale($custom->name);
71
+            $labels['custom_data.'.$custom->id] = Serialize::getDecodeLocale($custom->name);
72 72
         }
73 73
 
74 74
         return $labels;
@@ -93,12 +93,12 @@  discard block
 block discarded – undo
93 93
         // custom profile fields
94 94
         foreach (ProfileField::getAll() as $custom) {
95 95
             $rules[] = [
96
-                'custom_data.' . $custom->id,
96
+                'custom_data.'.$custom->id,
97 97
                 'used'
98 98
             ];
99 99
             $rules[] = [
100
-                'custom_data.' . $custom->id,
101
-                (int)$custom->reg_cond === 1 ? 'direct_match' : 'reverse_match',
100
+                'custom_data.'.$custom->id,
101
+                (int) $custom->reg_cond === 1 ? 'direct_match' : 'reverse_match',
102 102
                 $custom->reg_exp
103 103
             ];
104 104
         }
Please login to merge, or discard this patch.
Apps/Model/Front/Profile/FormAvatarUpload.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     public function copyFile(iUser $user)
48 48
     {
49 49
         // move file to original folder
50
-        $upload = $this->file->move(root . '/upload/user/avatar/original/', $user->id . '.' . $this->file->guessExtension());
50
+        $upload = $this->file->move(root.'/upload/user/avatar/original/', $user->id.'.'.$this->file->guessExtension());
51 51
 
52 52
         try {
53 53
             // big image
@@ -82,11 +82,11 @@  discard block
 block discarded – undo
82 82
         }
83 83
 
84 84
         $image = new Image();
85
-        $image->setCacheDir(root . '/Private/Cache/images');
85
+        $image->setCacheDir(root.'/Private/Cache/images');
86 86
 
87 87
         $image->open($original->getPathname())
88 88
             ->cropResize($sizeConvert[$size][0], $sizeConvert[$size][1])
89
-            ->save(root . '/upload/user/avatar/' . $size . '/' . $user_id . '.jpg', 'jpg', static::COMPRESS_QUALITY);
89
+            ->save(root.'/upload/user/avatar/'.$size.'/'.$user_id.'.jpg', 'jpg', static::COMPRESS_QUALITY);
90 90
 
91 91
         return null;
92 92
     }
Please login to merge, or discard this patch.
Apps/Model/Front/Content/EntityContentRead.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
         }
96 96
 
97 97
         $this->source = $this->_content->source;
98
-        $this->views = $this->_content->views+1;
98
+        $this->views = $this->_content->views + 1;
99 99
         // check for dependence, add '' for general cat, ex: general/depend1/depend2/.../depend-n
100 100
         $catNestingArray = Arr::merge([0 => ''], explode('/', $this->catPath));
101 101
         if ($catNestingArray > 1) {
@@ -127,15 +127,15 @@  discard block
 block discarded – undo
127 127
         ];
128 128
 
129 129
         // get gallery images and poster data
130
-        $galleryPath = '/upload/gallery/' . $this->_content->id;
130
+        $galleryPath = '/upload/gallery/'.$this->_content->id;
131 131
         // check if gallery folder is exist
132 132
         if (Directory::exist($galleryPath)) {
133
-            $originImages = File::listFiles($galleryPath . '/orig/', ['.jpg', '.png', '.gif', '.jpeg', '.bmp', '.webp'], true);
133
+            $originImages = File::listFiles($galleryPath.'/orig/', ['.jpg', '.png', '.gif', '.jpeg', '.bmp', '.webp'], true);
134 134
             // generate poster data
135 135
             if (Arr::in($this->_content->poster, $originImages)) {
136 136
                 // original poster
137 137
                 $posterName = $this->_content->poster;
138
-                $this->posterFull = $galleryPath . '/orig/' . $posterName;
138
+                $this->posterFull = $galleryPath.'/orig/'.$posterName;
139 139
                 if (!File::exist($this->posterFull)) {
140 140
                     $this->posterFull = null;
141 141
                 }
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
                 $posterSplit = explode('.', $posterName);
144 144
                 array_pop($posterSplit);
145 145
                 $posterCleanName = implode('.', $posterSplit);
146
-                $this->posterThumb = $galleryPath . '/thumb/' . $posterCleanName . '.jpg';
146
+                $this->posterThumb = $galleryPath.'/thumb/'.$posterCleanName.'.jpg';
147 147
                 if (!File::exist($this->posterThumb)) {
148 148
                     $this->posterThumb = null;
149 149
                 }
@@ -158,9 +158,9 @@  discard block
 block discarded – undo
158 158
                 if (Str::startsWith($imageClearName, $this->_content->poster)) {
159 159
                     continue;
160 160
                 }
161
-                $thumbPath = $galleryPath . '/thumb/' . $imageClearName . '.jpg';
161
+                $thumbPath = $galleryPath.'/thumb/'.$imageClearName.'.jpg';
162 162
                 if (File::exist($thumbPath)) {
163
-                    $this->galleryItems[$thumbPath] = $galleryPath . '/orig/' . $image;
163
+                    $this->galleryItems[$thumbPath] = $galleryPath.'/orig/'.$image;
164 164
                 }
165 165
             }
166 166
         }
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
         $this->rating = $this->_content->rating;
170 170
         $ignoredRate = App::$Session->get('content.rate.ignore');
171 171
         $this->canRate = true;
172
-        if (Obj::isArray($ignoredRate) && Arr::in((string)$this->id, $ignoredRate)) {
172
+        if (Obj::isArray($ignoredRate) && Arr::in((string) $this->id, $ignoredRate)) {
173 173
             $this->canRate = false;
174 174
         }
175 175
         if (!App::$User->isAuth()) {
Please login to merge, or discard this patch.
Apps/Model/Front/Content/EntityContentSearch.php 1 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.