Passed
Push — master ( 81a9f5...3de7ee )
by Mihail
04:22
created
Apps/Controller/Admin/Content.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
     public function actionIndex()
44 44
     {
45 45
         // set current page and offset
46
-        $page = (int)$this->request->query->get('page');
46
+        $page = (int) $this->request->query->get('page');
47 47
         $offset = $page * self::ITEM_PER_PAGE;
48 48
 
49 49
         $query = null;
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         } elseif ($type === 'moderate') { // only items on moderate
55 55
             $query = ContentEntity::where('display', '=', 0);
56 56
         } elseif (Any::isInt($type)) { // sounds like category id ;)
57
-            $query = ContentEntity::where('category_id', '=', (int)$type);
57
+            $query = ContentEntity::where('category_id', '=', (int) $type);
58 58
         } else {
59 59
             $query = new ContentEntity();
60 60
             $type = 'all';
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
     public function actionCategoryupdate($id = null)
265 265
     {
266 266
         // get owner id for new rows
267
-        $parentId = (int)$this->request->query->get('parent');
267
+        $parentId = (int) $this->request->query->get('parent');
268 268
 
269 269
         // get relation and pass to model
270 270
         $record = ContentCategory::findOrNew($id);
Please login to merge, or discard this patch.
Apps/Controller/Admin/Profile.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
         $query = ProfileRecords::with(['user']);
39 39
 
40 40
         // set current page and offset
41
-        $page = (int)$this->request->query->get('page');
41
+        $page = (int) $this->request->query->get('page');
42 42
         $offset = $page * self::ITEM_PER_PAGE;
43 43
 
44 44
         // build pagination
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
      */
69 69
     public function actionDelete($id)
70 70
     {
71
-        $this->response->redirect('user/delete/' . $id);
71
+        $this->response->redirect('user/delete/'.$id);
72 72
     }
73 73
 
74 74
     /**
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
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         $search = \Apps\ActiveRecord\App::getItem('app', $controller);
88 88
 
89 89
         // check what we got
90
-        if ($search === null || (int)$search->id < 1) {
90
+        if ($search === null || (int) $search->id < 1) {
91 91
             throw new NotFoundException('App is not founded');
92 92
         }
93 93
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 
120 120
         $search = \Apps\ActiveRecord\App::where('sys_name', '=', $controllerName)->where('type', '=', 'app')->first();
121 121
 
122
-        if ($search === null || (int)$search->id < 1) {
122
+        if ($search === null || (int) $search->id < 1) {
123 123
             throw new ForbiddenException('App is not founded');
124 124
         }
125 125
 
Please login to merge, or discard this patch.
Apps/Controller/Admin/User.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
         $query = new UserRecords();
41 41
 
42 42
         // set current page and offset
43
-        $page = (int)$this->request->query->get('page', 0);
43
+        $page = (int) $this->request->query->get('page', 0);
44 44
         $offset = $page * self::ITEM_PER_PAGE;
45 45
 
46 46
         // build pagination
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
     public function actionDelete($id = null)
102 102
     {
103 103
         // check if id is passed or get data from GET as array ids
104
-        if ((int)$id < 1) {
104
+        if ((int) $id < 1) {
105 105
             $ids = $this->request->query->get('selected');
106 106
             if (!Any::isArray($ids) || !Arr::onlyNumericValues($ids)) {
107 107
                 throw new NotFoundException('Bad conditions');
Please login to merge, or discard this patch.
Apps/Controller/Admin/Comments.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     public function actionIndex()
41 41
     {
42 42
         // set current page and offset
43
-        $page = (int)$this->request->query->get('page');
43
+        $page = (int) $this->request->query->get('page');
44 44
         $offset = $page * self::ITEM_PER_PAGE;
45 45
 
46 46
         // initialize active record model
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
     public function actionDelete($type, $id = 0)
144 144
     {
145 145
         // sounds like a multiply delete definition
146
-        if ($id === 0 || (int)$id < 1) {
146
+        if ($id === 0 || (int) $id < 1) {
147 147
             $ids = $this->request->query->get('selected');
148 148
             if (!Any::isArray($ids) || !Arr::onlyNumericValues($ids)) {
149 149
                 throw new NotFoundException('Bad conditions');
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
         if ($model->send() && $model->validate()) {
178 178
             $model->make();
179 179
             App::$Session->getFlashBag()->add('success', __('Comments or answers are successful deleted!'));
180
-            $this->response->redirect('comments/' . ($type === 'answer' ? 'answerlist' : 'index'));
180
+            $this->response->redirect('comments/'.($type === 'answer' ? 'answerlist' : 'index'));
181 181
         }
182 182
 
183 183
         // render view
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
     public function actionPublish($type, $id = 0)
199 199
     {
200 200
         // check if it multiple accept ids
201
-        if ($id === 0 || (int)$id < 1) {
201
+        if ($id === 0 || (int) $id < 1) {
202 202
             $ids = $this->request->query->get('selected');
203 203
             if (!Any::isArray($ids) || !Arr::onlyNumericValues($ids)) {
204 204
                 throw new NotFoundException('Bad conditions');
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
         if ($model->send()) {
232 232
             $model->make();
233 233
             App::$Session->getFlashBag()->add('success', __('Comments or answers are successful published'));
234
-            $this->response->redirect('comments/' . ($type === 'answer' ? 'answerlist' : 'index'));
234
+            $this->response->redirect('comments/'.($type === 'answer' ? 'answerlist' : 'index'));
235 235
         }
236 236
 
237 237
         return $this->view->render('publish', [
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
     public function actionAnswerlist()
249 249
     {
250 250
         // set current page and offset
251
-        $page = (int)$this->request->query->get('page');
251
+        $page = (int) $this->request->query->get('page');
252 252
         $offset = $page * self::ITEM_PER_PAGE;
253 253
 
254 254
         // initialize ar answers model
Please login to merge, or discard this patch.
Extend/Core/Captcha/Recaptcha.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
40 40
     public function get()
41 41
     {
42 42
         // build google captcha ;)
43
-        $html = '<div class="g-recaptcha" data-sitekey="' . self::$siteKey . '"></div>
43
+        $html = '<div class="g-recaptcha" data-sitekey="'.self::$siteKey.'"></div>
44 44
             <script type="text/javascript"
45
-                    src="https://www.google.com/recaptcha/api.js?hl=' . App::$Request->getLanguage() . '">
45
+                    src="https://www.google.com/recaptcha/api.js?hl=' . App::$Request->getLanguage().'">
46 46
             </script>';
47 47
         return $html;
48 48
     }
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         ]);
66 66
 
67 67
         // make request and parse response
68
-        $url = $request->getSchemeAndHttpHost() . $request->getRequestUri();
68
+        $url = $request->getSchemeAndHttpHost().$request->getRequestUri();
69 69
         $response = File::getFromUrl($url);
70 70
         $object = json_decode($response);
71 71
 
Please login to merge, or discard this patch.
Extend/Core/Arch/FrontAppController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
         }
34 34
 
35 35
         // add localizations
36
-        App::$Translate->append(App::$Alias->currentViewPath . '/I18n/' . App::$Request->getLanguage() . '.php');
36
+        App::$Translate->append(App::$Alias->currentViewPath.'/I18n/'.App::$Request->getLanguage().'.php');
37 37
         parent::__construct();
38 38
     }
39 39
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         }
57 57
 
58 58
         // check if disabled (0 = enabled, anything else = on)
59
-        return !(bool)$this->application->disabled;
59
+        return !(bool) $this->application->disabled;
60 60
     }
61 61
 
62 62
     /**
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
             return $this->configs;
70 70
         }
71 71
 
72
-        $configs = (array)$this->application->configs;
72
+        $configs = (array) $this->application->configs;
73 73
         foreach ($configs as $cfg => $value) {
74 74
             if (Any::isInt($value)) {
75 75
                 $configs[$cfg] = $value;
Please login to merge, or discard this patch.
Extend/Core/Arch/AdminController.php 1 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->role->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
         }
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
      */
147 147
     public function getConfigs()
148 148
     {
149
-        return $this->type === 'widget' ? (array)$this->widget->configs : (array)$this->application->configs;
149
+        return $this->type === 'widget' ? (array) $this->widget->configs : (array) $this->application->configs;
150 150
     }
151 151
 
152 152
     /**
Please login to merge, or discard this patch.
Extend/Core/Arch/FrontWidget.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,6 +55,6 @@
 block discarded – undo
55 55
         }
56 56
 
57 57
         // if widget is disabled - lets return nothing
58
-        return !(bool)$wData->disabled;
58
+        return !(bool) $wData->disabled;
59 59
     }
60 60
 }
Please login to merge, or discard this patch.