Passed
Push — master ( c86e8c...1b1f16 )
by Mihail
04:54
created
Apps/ActiveRecord/User.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -168,7 +168,7 @@
 block discarded – undo
168 168
     /**
169 169
      * Get user person like a object via email
170 170
      * @param string|null $email
171
-     * @return null|self
171
+     * @return null|ActiveModel
172 172
      */
173 173
     public static function getIdentityViaEmail(?string $email = null)
174 174
     {
Please login to merge, or discard this patch.
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\Any;
8
-use Ffcms\Core\Helper\Type\Obj;
9 8
 use Ffcms\Core\Helper\Type\Str;
10 9
 use Ffcms\Core\Interfaces\iUser;
11 10
 
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -50,13 +50,13 @@  discard block
 block discarded – undo
50 50
         }
51 51
 
52 52
         // check if id is looks like integer
53
-        if (!Any::isInt($id) || (int)$id < 1) {
53
+        if (!Any::isInt($id) || (int) $id < 1) {
54 54
             return null;
55 55
         }
56 56
 
57 57
         // check in memory cache object
58
-        if (MainApp::$Memory->get('user.object.cache.' . $id) !== null) {
59
-            return MainApp::$Memory->get('user.object.cache.' . $id);
58
+        if (MainApp::$Memory->get('user.object.cache.'.$id) !== null) {
59
+            return MainApp::$Memory->get('user.object.cache.'.$id);
60 60
         }
61 61
 
62 62
         // not founded in memory? lets make query
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
             ->find($id);
65 65
 
66 66
         // store cache and return object
67
-        MainApp::$Memory->set('user.object.cache.' . $user->id, $user);
67
+        MainApp::$Memory->set('user.object.cache.'.$user->id, $user);
68 68
         return $user;
69 69
     }
70 70
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
      */
75 75
     public function getId(): ?int
76 76
     {
77
-        return (int)$this->id;
77
+        return (int) $this->id;
78 78
     }
79 79
 
80 80
     /**
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     public static function isAuth(): bool
96 96
     {
97 97
         // get data from session
98
-        $sessionUserId = (int)MainApp::$Session->get('ff_user_id', 0);
98
+        $sessionUserId = (int) MainApp::$Session->get('ff_user_id', 0);
99 99
 
100 100
         // check if session contains user id data
101 101
         if ($sessionUserId < 1) {
@@ -128,10 +128,10 @@  discard block
 block discarded – undo
128 128
             return false;
129 129
         }
130 130
 
131
-        $find = MainApp::$Memory->get('user.counter.cache.' . $id);
131
+        $find = MainApp::$Memory->get('user.counter.cache.'.$id);
132 132
         if (!$find) {
133 133
             $find = self::where('id', $id)->count();
134
-            MainApp::$Memory->set('user.counter.cache.' . $id, $find);
134
+            MainApp::$Memory->set('user.counter.cache.'.$id, $find);
135 135
         }
136 136
 
137 137
         return $find === 1;
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
      */
232 232
     public function inBlacklist(?string $target = null): bool
233 233
     {
234
-        if ($target === null || (int)$target < 1) {
234
+        if ($target === null || (int) $target < 1) {
235 235
             return false;
236 236
         }
237 237
 
Please login to merge, or discard this patch.
Apps/Console/MigrationCreateCommand.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,6 @@
 block discarded – undo
5 5
 
6 6
 use Ffcms\Console\Command;
7 7
 use Ffcms\Core\Helper\FileSystem\File;
8
-use Ffcms\Core\Helper\Type\Obj;
9 8
 use Ffcms\Core\Helper\Type\Str;
10 9
 use Symfony\Component\Console\Input\InputArgument;
11 10
 use Symfony\Component\Console\Input\InputInterface;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,9 +58,9 @@
 block discarded – undo
58 58
         // work with migration template: read & parse & save
59 59
         $tpl = File::read('/Private/Carcase/Migration.tphp');
60 60
         $classContent = Str::replace(['%class%', '%table%'], [$name, $table], $tpl);
61
-        $fullPath = $dir . $name . '-' . $suffix . '.php';
61
+        $fullPath = $dir.$name.'-'.$suffix.'.php';
62 62
         File::write($fullPath, $classContent);
63 63
         // show success msg
64
-        $output->write('New migration is created: ' . $fullPath);
64
+        $output->write('New migration is created: '.$fullPath);
65 65
     }
66 66
 }
67 67
\ No newline at end of file
Please login to merge, or discard this patch.
Apps/Console/MigrationDownCommand.php 2 patches
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -5,10 +5,7 @@
 block discarded – undo
5 5
 
6 6
 use Apps\ActiveRecord\Migration;
7 7
 use Ffcms\Console\Command;
8
-use Ffcms\Core\Helper\FileSystem\File;
9 8
 use Ffcms\Core\Helper\Type\Any;
10
-use Ffcms\Core\Helper\Type\Obj;
11
-use Ffcms\Core\Helper\Type\Str;
12 9
 use Ffcms\Core\Managers\MigrationsManager;
13 10
 use Symfony\Component\Console\Input\InputArgument;
14 11
 use Symfony\Component\Console\Input\InputInterface;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
         // list found migrations and ask to revert each one
52 52
         $fired = false;
53 53
         foreach ($search as $migration) {
54
-            if (!$this->confirm('Are you sure to revert: ' . $migration)) {
54
+            if (!$this->confirm('Are you sure to revert: '.$migration)) {
55 55
                 continue;
56 56
             }
57 57
             // run down migration
Please login to merge, or discard this patch.
Apps/Console/MigrationUpCommand.php 2 patches
Unused Use Statements   -5 removed lines patch added patch discarded remove patch
@@ -3,13 +3,8 @@
 block discarded – undo
3 3
 namespace Apps\Console;
4 4
 
5 5
 
6
-use Apps\ActiveRecord\Migration;
7 6
 use Ffcms\Console\Command;
8
-use Ffcms\Core\Helper\FileSystem\File;
9 7
 use Ffcms\Core\Helper\Type\Any;
10
-use Ffcms\Core\Helper\Type\Arr;
11
-use Ffcms\Core\Helper\Type\Obj;
12
-use Ffcms\Core\Helper\Type\Str;
13 8
 use Ffcms\Core\Managers\MigrationsManager;
14 9
 use Symfony\Component\Console\Input\InputArgument;
15 10
 use Symfony\Component\Console\Input\InputInterface;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,11 +51,11 @@
 block discarded – undo
51 51
         // require confirmation from user each ever migration file
52 52
         $fired = false;
53 53
         foreach ($search as $migration) {
54
-            if (!$this->confirm('Are you sure to apply migration: ' . $migration, true)) {
54
+            if (!$this->confirm('Are you sure to apply migration: '.$migration, true)) {
55 55
                 continue;
56 56
             }
57 57
             $manager->makeUp($migration);
58
-            $fired =  true;
58
+            $fired = true;
59 59
         }
60 60
 
61 61
         if ($fired) {
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
@@ -11,7 +11,6 @@
 block discarded – undo
11 11
 use Ffcms\Core\Helper\FileSystem\Directory;
12 12
 use Ffcms\Core\Helper\FileSystem\File;
13 13
 use Ffcms\Core\Helper\Type\Any;
14
-use Ffcms\Core\Helper\Type\Obj;
15 14
 use Ffcms\Core\Helper\Type\Str;
16 15
 
17 16
 /**
Please login to merge, or discard this 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 (!$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
 
65 65
             if (!$this->authorId) {
@@ -94,8 +94,8 @@  discard block
 block discarded – undo
94 94
     public function rules(): array
95 95
     {
96 96
         $res = [
97
-            ['title.' . App::$Request->getLanguage(), 'required'],
98
-            ['text.' . App::$Request->getLanguage(), 'required'],
97
+            ['title.'.App::$Request->getLanguage(), 'required'],
98
+            ['text.'.App::$Request->getLanguage(), 'required'],
99 99
             ['text', 'used'],
100 100
             ['path', 'reverse_match', '/[\/\'~`\!@#\$%\^&\*\(\)+=\{\}\[\]\|;:"\<\>,\?\\\]/'],
101 101
             [['path', 'categoryId', 'authorId', 'display', 'galleryFreeId', 'title', 'important'], 'required'],
@@ -108,9 +108,9 @@  discard block
 block discarded – undo
108 108
         ];
109 109
 
110 110
         foreach (App::$Properties->get('languages') as $lang) {
111
-            $res[] = ['title.' . $lang, 'length_max', 120, null, true, true];
112
-            $res[] = ['keywords.' . $lang, 'length_max', 150];
113
-            $res[] = ['description.' . $lang, 'length_max', 250];
111
+            $res[] = ['title.'.$lang, 'length_max', 120, null, true, true];
112
+            $res[] = ['keywords.'.$lang, 'length_max', 150];
113
+            $res[] = ['description.'.$lang, 'length_max', 250];
114 114
         }
115 115
 
116 116
         return $res;
@@ -166,10 +166,10 @@  discard block
 block discarded – undo
166 166
         $this->_content->meta_keywords = $this->metaKeywords;
167 167
         $this->_content->meta_description = $this->metaDescription;
168 168
         $this->_content->source = $this->source;
169
-        $this->_content->important = (int)$this->important;
169
+        $this->_content->important = (int) $this->important;
170 170
         // check if rating is changed
171
-        if ((int)$this->addRating !== 0) {
172
-            $this->_content->rating += (int)$this->addRating;
171
+        if ((int) $this->addRating !== 0) {
172
+            $this->_content->rating += (int) $this->addRating;
173 173
         }
174 174
         // check if special comment hash is exist
175 175
         if ($this->_new || Str::length($this->_content->comment_hash) < 32) {
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
         }
183 183
 
184 184
         // save poster data
185
-        $posterPath = '/upload/gallery/' . $this->galleryFreeId . '/orig/' . $this->poster;
185
+        $posterPath = '/upload/gallery/'.$this->galleryFreeId.'/orig/'.$this->poster;
186 186
         if (File::exist($posterPath)) {
187 187
             $this->_content->poster = $this->poster;
188 188
         }
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 
218 218
         // move files
219 219
         if ($tmpGalleryId !== $this->_content->id) {
220
-            Directory::rename('/upload/gallery/' . $tmpGalleryId, $this->_content->id);
220
+            Directory::rename('/upload/gallery/'.$tmpGalleryId, $this->_content->id);
221 221
         }
222 222
     }
223 223
 
Please login to merge, or discard this patch.
Apps/Model/Admin/Main/FormUpdateDatabase.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 Apps\ActiveRecord\System;
6 6
 use Ffcms\Core\Arch\Model;
7
-use Ffcms\Core\Helper\FileSystem\File;
8 7
 use Ffcms\Core\Helper\Type\Str;
9 8
 use Ffcms\Core\Managers\MigrationsManager;
10 9
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
             $name = Str::firstIn($fullName, '-');
44 44
             // get update version number from migration name
45 45
             list($type, $obj, $version) = explode('_', $name);
46
-            $intVersion = (int)Str::replace('.', '', $this->dbVersion);
46
+            $intVersion = (int) Str::replace('.', '', $this->dbVersion);
47 47
             // if migration version > db version - implement it
48 48
             if ($version > $intVersion) {
49 49
                 $this->updateQueries[] = $file;
Please login to merge, or discard this patch.
Apps/Model/Admin/User/FormUserUpdate.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,6 @@
 block discarded – undo
8 8
 use Ffcms\Core\App;
9 9
 use Ffcms\Core\Arch\Model;
10 10
 use Ffcms\Core\Helper\Type\Any;
11
-use Ffcms\Core\Helper\Type\Obj;
12 11
 use Ffcms\Core\Helper\Type\Str;
13 12
 use Ffcms\Core\Interfaces\iUser;
14 13
 
Please login to merge, or discard this patch.
Apps/Model/Front/Content/EntityContentRead.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,6 @@
 block discarded – undo
12 12
 use Ffcms\Core\Helper\FileSystem\File;
13 13
 use Ffcms\Core\Helper\Type\Any;
14 14
 use Ffcms\Core\Helper\Type\Arr;
15
-use Ffcms\Core\Helper\Type\Obj;
16 15
 use Ffcms\Core\Helper\Type\Str;
17 16
 
18 17
 /**
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
     /**
67 67
      * Prepare model attributes from passed objects
68 68
      * @throws ForbiddenException
69
-    */
69
+     */
70 70
     public function before()
71 71
     {
72 72
         $this->id = $this->_content->id;
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
         $this->id = $this->_content->id;
73 73
         $this->title = $this->_content->getLocaled('title');
74 74
         $this->text = $this->_content->getLocaled('text');
75
-        $this->display = (bool)$this->_content->display;
75
+        $this->display = (bool) $this->_content->display;
76 76
 
77 77
         // check if title and text are exists
78 78
         if (Str::length($this->title) < 1 || Str::length($this->text) < 1) {
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         }
103 103
 
104 104
         $this->source = $this->_content->source;
105
-        $this->views = $this->_content->views+1;
105
+        $this->views = $this->_content->views + 1;
106 106
 
107 107
         // build category nesting sorted array
108 108
         $this->catNesting[] = $this->expandCategoryNesting();
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         $this->rating = $this->_content->rating;
114 114
         $ignoredRate = App::$Session->get('content.rate.ignore');
115 115
         $this->canRate = true;
116
-        if (Any::isArray($ignoredRate) && Arr::in((string)$this->id, $ignoredRate)) {
116
+        if (Any::isArray($ignoredRate) && Arr::in((string) $this->id, $ignoredRate)) {
117 117
             $this->canRate = false;
118 118
         }
119 119
         if (!App::$User->isAuth()) {
@@ -133,15 +133,15 @@  discard block
 block discarded – undo
133 133
     private function prepareGallery()
134 134
     {
135 135
         // get gallery images and poster data
136
-        $galleryPath = '/upload/gallery/' . $this->_content->id;
136
+        $galleryPath = '/upload/gallery/'.$this->_content->id;
137 137
         // check if gallery folder is exist
138 138
         if (Directory::exist($galleryPath)) {
139
-            $originImages = File::listFiles($galleryPath . '/orig/', ['.jpg', '.png', '.gif', '.jpeg', '.bmp', '.webp'], true);
139
+            $originImages = File::listFiles($galleryPath.'/orig/', ['.jpg', '.png', '.gif', '.jpeg', '.bmp', '.webp'], true);
140 140
             // generate poster data
141 141
             if (Arr::in($this->_content->poster, $originImages)) {
142 142
                 // original poster
143 143
                 $posterName = $this->_content->poster;
144
-                $this->posterFull = $galleryPath . '/orig/' . $posterName;
144
+                $this->posterFull = $galleryPath.'/orig/'.$posterName;
145 145
                 if (!File::exist($this->posterFull)) {
146 146
                     $this->posterFull = null;
147 147
                 }
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
                 $posterSplit = explode('.', $posterName);
151 151
                 array_pop($posterSplit);
152 152
                 $posterCleanName = implode('.', $posterSplit);
153
-                $this->posterThumb = $galleryPath . '/thumb/' . $posterCleanName . '.jpg';
153
+                $this->posterThumb = $galleryPath.'/thumb/'.$posterCleanName.'.jpg';
154 154
                 if (!File::exist($this->posterThumb)) {
155 155
                     $this->posterThumb = null;
156 156
                 }
@@ -166,9 +166,9 @@  discard block
 block discarded – undo
166 166
                     continue;
167 167
                 }
168 168
 
169
-                $thumbPath = $galleryPath . '/thumb/' . $imageClearName . '.jpg';
169
+                $thumbPath = $galleryPath.'/thumb/'.$imageClearName.'.jpg';
170 170
                 if (File::exist($thumbPath)) {
171
-                    $this->galleryItems[$thumbPath] = $galleryPath . '/orig/' . $image;
171
+                    $this->galleryItems[$thumbPath] = $galleryPath.'/orig/'.$image;
172 172
                 }
173 173
             }
174 174
         }
Please login to merge, or discard this patch.
Apps/Model/Front/Content/EntityContentSearch.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
     /**
33 33
      * EntityContentSearch constructor. Pass search terms (query string) to model and used items to skip it by id.
34 34
      * @param $terms
35
-     * @param int|array $skipIds
35
+     * @param integer $skipIds
36 36
      * @param int|null $categoryId
37 37
      */
38 38
     public function __construct($terms, $skipIds = 0, $categoryId = null)
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,6 @@
 block discarded – undo
8 8
 use Ffcms\Core\Exception\NotFoundException;
9 9
 use Ffcms\Core\Helper\Text;
10 10
 use Ffcms\Core\Helper\Type\Any;
11
-use Ffcms\Core\Helper\Type\Obj;
12 11
 use Ffcms\Core\Helper\Type\Str;
13 12
 
14 13
 /**
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
         $index = implode('-', $this->_skip);
63 63
         // try to get this slow query from cache
64
-        $cache = App::$Cache->getItem('entity.content.search.index.' . $index);
64
+        $cache = App::$Cache->getItem('entity.content.search.index.'.$index);
65 65
         if (!$cache->isHit()) {
66 66
             $cache->set($this->makeSearch());
67 67
             $cache->expiresAfter(static::CACHE_TIME);
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
             $this->items[] = [
95 95
                 'title' => $item->getLocaled('title'),
96 96
                 'snippet' => Text::snippet($text),
97
-                'uri' => '/content/read/' . $item->getPath(),
97
+                'uri' => '/content/read/'.$item->getPath(),
98 98
                 'thumb' => $item->getPosterThumbUri()
99 99
             ];
100 100
         }
Please login to merge, or discard this patch.