Passed
Push — master ( 3d6fe1...2c7b25 )
by Mihail
05:25
created
Extend/Core/Arch/AdminController.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@
 block discarded – undo
123 123
     /**
124 124
      * Get current extension active record
125 125
      * @param string|null $type
126
-     * @return mixed
126
+     * @return AppRecord
127 127
      */
128 128
     public function getTypeItem($type = null)
129 129
     {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -86,18 +86,18 @@  discard block
 block discarded – undo
86 86
         $user = App::$User->identity();
87 87
         // user is not authed ?
88 88
         if ($user === null || !App::$User->isAuth()) {
89
-            $redirectUrl = App::$Alias->scriptUrl . '/user/login';
89
+            $redirectUrl = App::$Alias->scriptUrl.'/user/login';
90 90
             App::$Response->redirect($redirectUrl, true);
91 91
             exit();
92 92
         }
93 93
 
94
-        $permission = env_name . '/' . App::$Request->getController() . '/' . App::$Request->getAction();
94
+        $permission = env_name.'/'.App::$Request->getController().'/'.App::$Request->getAction();
95 95
 
96 96
         // doesn't have permission? get the f*ck out
97 97
         if (!$user->getRole()->can($permission)) {
98 98
             App::$Session->invalidate();
99 99
 
100
-            $redirectUrl = App::$Alias->scriptUrl . '/user/login';
100
+            $redirectUrl = App::$Alias->scriptUrl.'/user/login';
101 101
             App::$Response->redirect($redirectUrl, true);
102 102
             exit();
103 103
         }
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
      */
145 145
     public function getConfigs()
146 146
     {
147
-        return $this->type === 'widget' ? (array)Serialize::decode($this->widget->configs) : (array)Serialize::decode($this->application->configs);
147
+        return $this->type === 'widget' ? (array) Serialize::decode($this->widget->configs) : (array) Serialize::decode($this->application->configs);
148 148
     }
149 149
 
150 150
     /**
Please login to merge, or discard this patch.
Apps/Controller/Admin/Application.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         $search = \Apps\ActiveRecord\App::getItem('app', $controller);
72 72
 
73 73
         // check what we got
74
-        if ($search === null || (int)$search->id < 1) {
74
+        if ($search === null || (int) $search->id < 1) {
75 75
             throw new ForbiddenException('App is not founded');
76 76
         }
77 77
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
         $search = \Apps\ActiveRecord\App::where('sys_name', '=', $controllerName)->where('type', '=', 'app')->first();
98 98
 
99
-        if ($search === null || (int)$search->id < 1) {
99
+        if ($search === null || (int) $search->id < 1) {
100 100
             throw new ForbiddenException('App is not founded');
101 101
         }
102 102
 
Please login to merge, or discard this patch.
Apps/ActiveRecord/App.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
      * Get single row by defined type and sys_name with query caching
60 60
      * @param string $type
61 61
      * @param string $sys_name
62
-     * @return mixed|null
62
+     * @return App
63 63
      * @throws SyntaxException
64 64
      */
65 65
     public static function getItem($type, $sys_name)
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 
149 149
         $scriptVersion = $this->getScriptVersion();
150 150
 
151
-        return $scriptVersion === (float)$this->version;
151
+        return $scriptVersion === (float) $this->version;
152 152
     }
153 153
 
154 154
     /**
@@ -157,16 +157,16 @@  discard block
 block discarded – undo
157 157
      */
158 158
     public function getScriptVersion()
159 159
     {
160
-        $class = 'Apps\Controller\Admin\\' . $this->sys_name;
160
+        $class = 'Apps\Controller\Admin\\'.$this->sys_name;
161 161
         if (!class_exists($class)) {
162 162
             return false;
163 163
         }
164 164
 
165
-        if (!defined($class . '::VERSION')) {
165
+        if (!defined($class.'::VERSION')) {
166 166
             return false;
167 167
         }
168 168
 
169
-        return (float)constant($class . '::VERSION');
169
+        return (float) constant($class.'::VERSION');
170 170
     }
171 171
 
172 172
 }
173 173
\ No newline at end of file
Please login to merge, or discard this patch.
Apps/Model/Admin/Application/FormUpdate.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,6 @@
 block discarded – undo
5 5
 use Apps\ActiveRecord\App as AppRecord;
6 6
 use Ffcms\Core\Arch\Model;
7 7
 use Ffcms\Core\Exception\ForbiddenException;
8
-use Ffcms\Core\Exception\NativeException;
9 8
 use Ffcms\Core\Exception\NotFoundException;
10 9
 use Ffcms\Core\Helper\Date;
11 10
 
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@
 block discarded – undo
28 28
     }
29 29
 
30 30
     /**
31
-    * Magic method before
32
-    */
31
+     * Magic method before
32
+     */
33 33
     public function before()
34 34
     {
35 35
         // get full name of update object
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
     public function before()
34 34
     {
35 35
         // get full name of update object
36
-        $class = 'Apps\Controller\Admin\\' . $this->_record->sys_name;
36
+        $class = 'Apps\Controller\Admin\\'.$this->_record->sys_name;
37 37
         if (class_exists($class)) {
38 38
             $this->_callback = $class;
39 39
         } else {
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
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
     {
13 13
         $status = $object->disabled;
14 14
 
15
-        $object->disabled = (int)!$status; // magic inside: bool to int and reverse - 0 => 1, 1 => 0
15
+        $object->disabled = (int) !$status; // magic inside: bool to int and reverse - 0 => 1, 1 => 0
16 16
         $object->save();
17 17
     }
18 18
 }
19 19
\ No newline at end of file
Please login to merge, or discard this patch.
Apps/View/Admin/default/widget/turn.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
             [['text' => __('Name')], ['text' => $widget->getLocaleName()]],
32 32
             [['text' => __('System name')], ['text' => $widget->sys_name]],
33 33
             [['text' => __('Last update')], ['text' => Date::convertToDatetime($widget->updated_at, DATE::FORMAT_TO_SECONDS)]],
34
-            [['text' => __('Status')], ['text' => ((int)$widget->disabled === 0) ? 'On' : 'Off'], 'property' => ['class' =>  ((int)$widget->disabled === 0) ? 'alert-success' : 'alert-danger']]
34
+            [['text' => __('Status')], ['text' => ((int) $widget->disabled === 0) ? 'On' : 'Off'], 'property' => ['class' =>  ((int) $widget->disabled === 0) ? 'alert-success' : 'alert-danger']]
35 35
         ]
36 36
     ]
37 37
 ]); ?>
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
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         $search = \Apps\ActiveRecord\App::getItem('app', $controller);
72 72
 
73 73
         // check what we got
74
-        if ($search === null || (int)$search->id < 1) {
74
+        if ($search === null || (int) $search->id < 1) {
75 75
             throw new ForbiddenException('App is not founded');
76 76
         }
77 77
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
         $search = \Apps\ActiveRecord\App::where('sys_name', '=', $controllerName)->where('type', '=', 'app')->first();
98 98
 
99
-        if ($search === null || (int)$search->id < 1) {
99
+        if ($search === null || (int) $search->id < 1) {
100 100
             throw new ForbiddenException('App is not founded');
101 101
         }
102 102
 
Please login to merge, or discard this patch.
Apps/View/Admin/default/comments/_tabs.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,4 +9,4 @@
 block discarded – undo
9 9
         ['type' => 'link', 'text' => __('Group management'), 'link' => ['user/grouplist']],
10 10
         ['type' => 'link', 'text' => __('Settings'), 'link' => ['user/settings']]
11 11
     ]
12
-]);?>
13 12
\ No newline at end of file
13
+]); ?>
14 14
\ No newline at end of file
Please login to merge, or discard this patch.
Apps/Model/Front/Content/EntityCategoryList.php 2 patches
Unused Use Statements   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,9 +3,8 @@
 block discarded – undo
3 3
 namespace Apps\Model\Front\Content;
4 4
 
5 5
 
6
-use Apps\ActiveRecord\Content;
7
-use Apps\ActiveRecord\ContentCategory;
8 6
 use Apps\ActiveRecord\Content as ContentRecord;
7
+use Apps\ActiveRecord\ContentCategory;
9 8
 use Apps\ActiveRecord\User;
10 9
 use Ffcms\Core\App;
11 10
 use Ffcms\Core\Arch\Model;
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     {
60 60
         $this->_path = $path;
61 61
         $this->_configs = $configs;
62
-        $this->_page = (int)$offset;
62
+        $this->_page = (int) $offset;
63 63
         $this->_sort = $sort;
64 64
         parent::__construct();
65 65
     }
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     public function before()
73 73
     {
74 74
         // find one or more categories where we must looking for content items
75
-        if ((int)$this->_configs['multiCategories'] === 1) {
75
+        if ((int) $this->_configs['multiCategories'] === 1) {
76 76
             $this->findCategories();
77 77
         } else {
78 78
             $this->findCategory();
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
      */
92 92
     public function setItemLimit($limit)
93 93
     {
94
-        $this->_customItemLimit = (int)$limit;
94
+        $this->_customItemLimit = (int) $limit;
95 95
     }
96 96
 
97 97
     /**
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
     private function findCategories()
120 120
     {
121 121
         // get all categories for current path and child of it
122
-        $query = ContentCategory::where('path', 'like', $this->_path . '%');
122
+        $query = ContentCategory::where('path', 'like', $this->_path.'%');
123 123
         if ($query->count() < 1) {
124 124
             throw new NotFoundException(__('Category is not founded'));
125 125
         }
@@ -152,10 +152,10 @@  discard block
 block discarded – undo
152 152
         }
153 153
 
154 154
         // calculate selection offset
155
-        $itemPerPage = (int)$this->_configs['itemPerCategory'];
155
+        $itemPerPage = (int) $this->_configs['itemPerCategory'];
156 156
         // check if custom itemlimit defined over model api
157 157
         if ($this->_customItemLimit !== false) {
158
-            $itemPerPage = (int)$this->_customItemLimit;
158
+            $itemPerPage = (int) $this->_customItemLimit;
159 159
         }
160 160
 
161 161
         $offset = $this->_page * $itemPerPage;
@@ -197,15 +197,15 @@  discard block
 block discarded – undo
197 197
         $catConfigs = Serialize::decode($this->_currentCategory->configs);
198 198
         // prepare rss url link for current category if enabled
199 199
         $rssUrl = false;
200
-        if ((int)$this->_configs['rss'] === 1 && (int)$catConfigs['showRss'] === 1) {
201
-            $rssUrl = App::$Alias->baseUrl . '/content/rss/' . $this->_currentCategory->path;
200
+        if ((int) $this->_configs['rss'] === 1 && (int) $catConfigs['showRss'] === 1) {
201
+            $rssUrl = App::$Alias->baseUrl.'/content/rss/'.$this->_currentCategory->path;
202 202
             $rssUrl = rtrim($rssUrl, '/');
203 203
         }
204 204
 
205 205
         // prepare sorting urls
206 206
         $catSortParams = [];
207 207
         if (App::$Request->query->get('page') !== null) {
208
-            $catSortParams['page'] = (int)App::$Request->query->get('page');
208
+            $catSortParams['page'] = (int) App::$Request->query->get('page');
209 209
         }
210 210
         $catSortUrls = [
211 211
             'views' => Url::to('content/list', $this->_currentCategory->path, null, Arr::merge($catSortParams, ['sort' => 'views']), false),
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
         ];
225 225
 
226 226
         // check if this category is hidden
227
-        if ((int)$this->category['configs']['showCategory'] !== 1) {
227
+        if ((int) $this->category['configs']['showCategory'] !== 1) {
228 228
             throw new ForbiddenException(__('This category is not available to view'));
229 229
         }
230 230
 
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
             // check if current user can rate item
280 280
             $ignoredRate = App::$Session->get('content.rate.ignore');
281 281
             $canRate = true;
282
-            if (Obj::isArray($ignoredRate) && Arr::in((string)$row->id, $ignoredRate)) {
282
+            if (Obj::isArray($ignoredRate) && Arr::in((string) $row->id, $ignoredRate)) {
283 283
                 $canRate = false;
284 284
             }
285 285
             if (!App::$User->isAuth()) {
@@ -299,11 +299,11 @@  discard block
 block discarded – undo
299 299
                 'poster' => $row->getPosterUri(),
300 300
                 'thumb' => $row->getPosterThumbUri(),
301 301
                 'thumbSize' => File::size($row->getPosterThumbUri()),
302
-                'views' => (int)$row->views,
303
-                'rating' => (int)$row->rating,
302
+                'views' => (int) $row->views,
303
+                'rating' => (int) $row->rating,
304 304
                 'canRate' => $canRate,
305 305
                 'category' => $this->categories[$row->category_id],
306
-                'uri' => '/content/read/' . $itemPath,
306
+                'uri' => '/content/read/'.$itemPath,
307 307
                 'tags' => $tags
308 308
             ];
309 309
         }
Please login to merge, or discard this patch.