Passed
Push — master ( ef8807...c1ca83 )
by Mihail
05:17
created
Apps/Model/Front/Content/FormNarrowContentUpdate.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -57,13 +57,13 @@  discard block
 block discarded – undo
57 57
         // set current user id
58 58
         $this->authorId = App::$User->identity()->getId();
59 59
         // set true if it is a new content item
60
-        if ($this->_record->id === null || (int)$this->_record->id < 1) {
60
+        if ($this->_record->id === null || (int) $this->_record->id < 1) {
61 61
             $this->_new = true;
62 62
         }
63 63
 
64 64
         // set random path slug if not defined
65 65
         if ($this->path === null || Str::likeEmpty($this->path)) {
66
-            $randPath = date('d-m-Y') . '-' . Str::randomLatin(mt_rand(8, 12));
66
+            $randPath = date('d-m-Y').'-'.Str::randomLatin(mt_rand(8, 12));
67 67
             $this->path = Str::lowerCase($randPath);
68 68
         }
69 69
     }
@@ -107,21 +107,21 @@  discard block
 block discarded – undo
107 107
     {
108 108
         $r = [
109 109
             [['path', 'categoryId'], 'required'],
110
-            ['title.' . App::$Request->getLanguage(), 'required'],
111
-            ['text.' . App::$Request->getLanguage(), 'required', null, true, true],
110
+            ['title.'.App::$Request->getLanguage(), 'required'],
111
+            ['text.'.App::$Request->getLanguage(), 'required', null, true, true],
112 112
             ['text', 'used', null, true, true],
113 113
             ['path', 'direct_match', '/^[a-zA-Z0-9\-]+$/'],
114 114
             ['categoryId', 'in', $this->categoryIds()],
115 115
             ['path', 'Apps\Model\Front\Content\FormNarrowContentUpdate::validatePath'],
116 116
             ['poster', 'used'],
117 117
             ['poster', 'isFile', ['jpg', 'png', 'gif', 'jpeg']],
118
-            ['poster', 'sizeFile', (int)$this->_configs['gallerySize'] * 1024] // in bytes
118
+            ['poster', 'sizeFile', (int) $this->_configs['gallerySize'] * 1024] // in bytes
119 119
         ];
120 120
 
121 121
         foreach (App::$Properties->get('languages') as $lang) {
122
-            $r[] = ['title.' . $lang, 'length_max', 120, null, true, true];
123
-            $r[] = ['keywords.' . $lang, 'length_max', 150];
124
-            $r[] = ['description.' . $lang, 'length_max', 250];
122
+            $r[] = ['title.'.$lang, 'length_max', 120, null, true, true];
123
+            $r[] = ['keywords.'.$lang, 'length_max', 150];
124
+            $r[] = ['description.'.$lang, 'length_max', 250];
125 125
         }
126 126
 
127 127
         return $r;
@@ -147,9 +147,9 @@  discard block
 block discarded – undo
147 147
         $this->_record->title = $this->title;
148 148
         $this->_record->text = $this->text;
149 149
         $this->_record->path = $this->path;
150
-        $this->_record->category_id = (int)$this->categoryId;
150
+        $this->_record->category_id = (int) $this->categoryId;
151 151
         $this->_record->display = 0; // set to premoderation
152
-        $this->_record->author_id = (int)$this->authorId;
152
+        $this->_record->author_id = (int) $this->authorId;
153 153
         if ($this->_new) {
154 154
             $this->_record->comment_hash = $this->generateCommentHash();
155 155
         }
@@ -159,8 +159,8 @@  discard block
 block discarded – undo
159 159
         // work with poster data
160 160
         if ($this->poster !== null) {
161 161
             // lets move poster from tmp to gallery
162
-            $originDir = '/upload/gallery/' . $this->_record->id . '/orig/';
163
-            $thumbDir = '/upload/gallery/' . $this->_record->id . '/thumb/';
162
+            $originDir = '/upload/gallery/'.$this->_record->id.'/orig/';
163
+            $thumbDir = '/upload/gallery/'.$this->_record->id.'/thumb/';
164 164
             if (!Directory::exist($originDir)) {
165 165
                 Directory::create($originDir);
166 166
             }
@@ -169,17 +169,17 @@  discard block
 block discarded – undo
169 169
                 Directory::create($thumbDir);
170 170
             }
171 171
 
172
-            $fileName = App::$Security->simpleHash($this->poster->getClientOriginalName() . $this->poster->getSize());
173
-            $newFullName = $fileName . '.' . $this->poster->guessExtension();
172
+            $fileName = App::$Security->simpleHash($this->poster->getClientOriginalName().$this->poster->getSize());
173
+            $newFullName = $fileName.'.'.$this->poster->guessExtension();
174 174
             // move poster to upload gallery directory
175 175
             $this->poster->move(Normalize::diskFullPath($originDir), $newFullName);
176 176
             // initialize image resizer
177 177
             $thumb = new Image();
178
-            $thumb->setCacheDir(root . '/Private/Cache/images');
178
+            $thumb->setCacheDir(root.'/Private/Cache/images');
179 179
 
180 180
             // open original file, resize it and save
181
-            $thumbSaveName = Normalize::diskFullPath($thumbDir) . '/' . $fileName . '.jpg';
182
-            $thumb->open(Normalize::diskFullPath($originDir) . DIRECTORY_SEPARATOR . $newFullName)
181
+            $thumbSaveName = Normalize::diskFullPath($thumbDir).'/'.$fileName.'.jpg';
182
+            $thumb->open(Normalize::diskFullPath($originDir).DIRECTORY_SEPARATOR.$newFullName)
183 183
                 ->cropResize($this->_configs['galleryResize'])
184 184
                 ->save($thumbSaveName, 'jpg', 90);
185 185
             $thumb = null;
Please login to merge, or discard this patch.
Apps/Model/Front/Search/EntitySearchMain.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
      */
37 37
     public function make()
38 38
     {
39
-        $itemCount = (int)$this->_configs['itemPerApp'];
39
+        $itemCount = (int) $this->_configs['itemPerApp'];
40 40
         // search content items
41 41
         $content = new SearchContent($this->query, $itemCount);
42 42
         $this->results['Content'] = $content->getResult();
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
                 /** @var AbstractSearchResult $item */
64 64
                 // build unique relevance. Problem: returned relevance from query is integer
65 65
                 // and can be duplicated. So, we add random complex float value and make it string to sort in feature
66
-                $uniqueRelevance = (string)($item->getRelevance() + (mt_rand(0, 999)/10000));
66
+                $uniqueRelevance = (string) ($item->getRelevance() + (mt_rand(0, 999) / 10000));
67 67
                 // build response
68 68
                 $result[$uniqueRelevance] = [
69 69
                     'title' => $item->getTitle(),
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
         $queries = explode(' ', $this->query);
94 94
         $dom = new Dom();
95 95
         foreach ($queries as $query) {
96
-            $highlight = $dom->{$tag}(function () use ($query) {
96
+            $highlight = $dom->{$tag}(function() use ($query) {
97 97
                 return $query;
98 98
             }, $properties);
99 99
             $text = Str::ireplace($query, $highlight, $text);
Please login to merge, or discard this patch.
Apps/Model/Front/Sitemap/EntityIndexList.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -48,11 +48,11 @@  discard block
 block discarded – undo
48 48
         $scan = File::listFiles(static::INDEX_PATH, ['.xml'], true);
49 49
         if (Any::isArray($scan)) {
50 50
             foreach ($scan as $file) {
51
-                if ($this->_lang !== null && !Str::contains('.' . $this->_lang, $file)) {
51
+                if ($this->_lang !== null && !Str::contains('.'.$this->_lang, $file)) {
52 52
                     continue;
53 53
                 }
54 54
 
55
-                $this->files[] = static::INDEX_PATH . '/' . $file;
55
+                $this->files[] = static::INDEX_PATH.'/'.$file;
56 56
             }
57 57
         }
58 58
     }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         // build file information data
70 70
         foreach ($this->files as $file) {
71 71
             $this->info[] = [
72
-                'loc' => App::$Alias->scriptUrl . $file,
72
+                'loc' => App::$Alias->scriptUrl.$file,
73 73
                 'lastmod' => Date::convertToDatetime(File::mTime($file), 'c')
74 74
             ];
75 75
         }
Please login to merge, or discard this patch.
Apps/Model/Front/Feedback/FormFeedbackAdd.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
      */
29 29
     public function __construct($captcha = true)
30 30
     {
31
-        $this->_useCaptcha = (bool)$captcha;
31
+        $this->_useCaptcha = (bool) $captcha;
32 32
         parent::__construct();
33 33
     }
34 34
 
Please login to merge, or discard this patch.
Apps/Model/Admin/Content/FormCategoryDelete.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
         }
81 81
 
82 82
         // get all depended category ids
83
-        $cats = ContentCategory::where('path', 'like', $this->_record->path . '%')->get(['id'])->toArray();
83
+        $cats = ContentCategory::where('path', 'like', $this->_record->path.'%')->get(['id'])->toArray();
84 84
         $allCategoryIds = Arr::pluck('id', $cats);
85 85
 
86 86
         // update category_id in content
Please login to merge, or discard this patch.
Apps/Model/Admin/Contenttag/FormSettings.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,8 +30,8 @@
 block discarded – undo
30 30
      */
31 31
     public function before()
32 32
     {
33
-        $this->count = (int)$this->_configs['count'];
34
-        $this->cache = (int)$this->_configs['cache'];
33
+        $this->count = (int) $this->_configs['count'];
34
+        $this->cache = (int) $this->_configs['cache'];
35 35
     }
36 36
 
37 37
     /**
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
 }
Please login to merge, or discard this patch.
Apps/Model/Admin/Newcomment/FormSettings.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,9 +31,9 @@
 block discarded – undo
31 31
      */
32 32
     public function before()
33 33
     {
34
-        $this->snippet = (int)$this->_configs['snippet'];
35
-        $this->count = (int)$this->_configs['count'];
36
-        $this->cache = (int)$this->_configs['cache'];
34
+        $this->snippet = (int) $this->_configs['snippet'];
35
+        $this->count = (int) $this->_configs['count'];
36
+        $this->cache = (int) $this->_configs['cache'];
37 37
     }
38 38
 
39 39
     /**
Please login to merge, or discard this patch.
Apps/Model/Admin/User/FormUserDelete.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -69,10 +69,10 @@
 block discarded – undo
69 69
                 ->orWhere('sender_id', '=', $uid)
70 70
                 ->delete();
71 71
             // delete avatars
72
-            File::remove('/upload/user/avatar/big/' . $uid . '.jpg');
73
-            File::remove('/upload/user/avatar/medium/' . $uid . '.jpg');
74
-            File::remove('/upload/user/avatar/small/' . $uid . '.jpg');
75
-            File::remove('/upload/user/avatar/original/' . $uid . '.jpg');
72
+            File::remove('/upload/user/avatar/big/'.$uid.'.jpg');
73
+            File::remove('/upload/user/avatar/medium/'.$uid.'.jpg');
74
+            File::remove('/upload/user/avatar/small/'.$uid.'.jpg');
75
+            File::remove('/upload/user/avatar/original/'.$uid.'.jpg');
76 76
             // delete user profile and auth data
77 77
             $user->profile()->delete();
78 78
             // delete user provider data
Please login to merge, or discard this patch.