Passed
Push — master ( 3db37c...11f6ba )
by Mihail
04:15
created
Apps/Controller/Front/Profile.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
         $records = null;
37 37
 
38 38
         // set current page and offset
39
-        $page = (int)App::$Request->query->get('page');
39
+        $page = (int) App::$Request->query->get('page');
40 40
         $cfgs = Serialize::decode($this->application->configs);
41
-        $userPerPage = (int)$cfgs['usersOnPage'];
41
+        $userPerPage = (int) $cfgs['usersOnPage'];
42 42
         if ($userPerPage < 1) {
43 43
             $userPerPage = 1;
44 44
         }
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
         switch ($filter_name) {
48 48
             case 'rating': // rating list, order by rating DESC
49 49
                 // check if rating is enabled
50
-                if ((int)$cfgs['rating'] !== 1) {
50
+                if ((int) $cfgs['rating'] !== 1) {
51 51
                     throw new NotFoundException();
52 52
                 }
53 53
                 $records = (new ProfileRecords())->orderBy('rating', 'DESC');
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
             'pagination' => $pagination,
92 92
             'id' => $filter_name,
93 93
             'add' => $filter_value,
94
-            'ratingOn' => (int)$cfgs['rating']
94
+            'ratingOn' => (int) $cfgs['rating']
95 95
         ]);
96 96
     }
97 97
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
     public function actionShow($userId)
105 105
     {
106 106
         $cfg = Serialize::decode($this->application->configs);
107
-        if ((int)$cfg['guestView'] !== 1 && !App::$User->isAuth()) {
107
+        if ((int) $cfg['guestView'] !== 1 && !App::$User->isAuth()) {
108 108
             throw new ForbiddenException('You must be registered user to view other profile');
109 109
         }
110 110
         // check if target exists
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
                     App::$Session->getFlashBag()->add('error', __('This user are in your black list or you are in blacklist!'));
127 127
                 } else {
128 128
                     // check if message added
129
-                    if ($wallModel->makePost($targetPersone, $viewerPersone, (int)$cfg['delayBetweenPost'])) {
129
+                    if ($wallModel->makePost($targetPersone, $viewerPersone, (int) $cfg['delayBetweenPost'])) {
130 130
                         App::$Session->getFlashBag()->add('success', __('The message was successful posted!'));
131 131
                     } else {
132 132
                         App::$Session->getFlashBag()->add('warning', __('Posting message was failed! You need to wait some time...'));
@@ -137,8 +137,8 @@  discard block
 block discarded – undo
137 137
 
138 138
         $query = $targetPersone->getWall(); // relation hasMany from users to walls
139 139
         // pagination and query params
140
-        $wallPage = (int)App::$Request->query->get('page');
141
-        $wallItems = (int)$cfg['wallPostOnPage'];
140
+        $wallPage = (int) App::$Request->query->get('page');
141
+        $wallItems = (int) $cfg['wallPostOnPage'];
142 142
         $wallOffset = $wallPage * $wallItems;
143 143
 
144 144
         // build pagination
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
             'notify' => App::$Session->getFlashBag()->all(),
161 161
             'wallRecords' => $wallRecords,
162 162
             'pagination' => $wallPagination,
163
-            'ratingOn' => (int)$cfg['rating'] === 1
163
+            'ratingOn' => (int) $cfg['rating'] === 1
164 164
         ]);
165 165
     }
166 166
 
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 
321 321
         // set user id from ?id= get param if form not sended
322 322
         if (!$model->send()) {
323
-            $uid = (int)App::$Request->query->get('id');
323
+            $uid = (int) App::$Request->query->get('id');
324 324
             if ($uid > 0) {
325 325
                 $model->id = $uid;
326 326
             }
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
         // get blocked users
339 339
         $records = Blacklist::where('user_id', '=', $user->getId());
340 340
 
341
-        $page = (int)App::$Request->query->get('page');
341
+        $page = (int) App::$Request->query->get('page');
342 342
         $offset = $page * self::BLOCK_PER_PAGE;
343 343
 
344 344
         // build pagination
@@ -411,15 +411,15 @@  discard block
 block discarded – undo
411 411
         if ($model->send() && $model->validate()) {
412 412
             // get records from db
413 413
             $records = ProfileRecords::where('nick', 'like', '%' . $model->query . '%');
414
-            $page = (int)App::$Request->query->get('page');
415
-            $userPerPage = (int)$cfgs['usersOnPage'];
414
+            $page = (int) App::$Request->query->get('page');
415
+            $userPerPage = (int) $cfgs['usersOnPage'];
416 416
             if ($userPerPage < 1) {
417 417
                 $userPerPage = 1;
418 418
             }
419 419
             $offset = $page * $userPerPage;
420 420
             // build pagination
421 421
             $pagination = new SimplePagination([
422
-                'url' => ['profile/search', null, null, [$model->getFormName().'[query]' => $model->query, $model->getFormName().'[submit]' => true]],
422
+                'url' => ['profile/search', null, null, [$model->getFormName() . '[query]' => $model->query, $model->getFormName() . '[submit]' => true]],
423 423
                 'page' => $page,
424 424
                 'step' => $userPerPage,
425 425
                 'total' => $records->count()
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
             'model' => $model->export(),
435 435
             'records' => $records,
436 436
             'pagination' => $pagination,
437
-            'ratingOn' => (int)$cfgs['rating']
437
+            'ratingOn' => (int) $cfgs['rating']
438 438
         ]);
439 439
     }
440 440
 }
441 441
\ No newline at end of file
Please login to merge, or discard this patch.
Apps/Model/Admin/Application/FormAppTurn.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/Model/Admin/Content/FormCategoryDelete.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -29,8 +29,8 @@  discard block
 block discarded – undo
29 29
     }
30 30
 
31 31
     /**
32
-    * Pass properties from record construction
33
-    */
32
+     * Pass properties from record construction
33
+     */
34 34
     public function before()
35 35
     {
36 36
         $this->title = Serialize::getDecodeLocale($this->_record->title);
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
     }
39 39
 
40 40
     /**
41
-    * Form labels
42
-    */
41
+     * Form labels
42
+     */
43 43
     public function labels()
44 44
     {
45 45
         return [
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
     }
51 51
 
52 52
     /**
53
-    * Validation rules
54
-    */
53
+     * Validation rules
54
+     */
55 55
     public function rules()
56 56
     {
57 57
         return [
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@
 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/FormContentClear.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
     }
16 16
 
17 17
     /**
18
-    * Example of usage magic labels for future form helper usage
19
-    */
18
+     * Example of usage magic labels for future form helper usage
19
+     */
20 20
     public function labels()
21 21
     {
22 22
         return [
@@ -25,8 +25,8 @@  discard block
 block discarded – undo
25 25
     }
26 26
 
27 27
     /**
28
-    * Typo rules
29
-    */
28
+     * Typo rules
29
+     */
30 30
     public function rules()
31 31
     {
32 32
         return [];
Please login to merge, or discard this patch.
Apps/Model/Admin/Content/FormContentDelete.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
     }
25 25
 
26 26
     /**
27
-    * Set readable title of content to property
28
-    */
27
+     * Set readable title of content to property
28
+     */
29 29
     public function before()
30 30
     {
31 31
         $this->id = $this->_record->id;
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
     }
34 34
 
35 35
     /**
36
-    * Form labels
37
-    */
36
+     * Form labels
37
+     */
38 38
     public function labels()
39 39
     {
40 40
         return [
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
     }
44 44
 
45 45
     /**
46
-    * Validation does not matter
47
-    */
46
+     * Validation does not matter
47
+     */
48 48
     public function rules()
49 49
     {
50 50
         return [
Please login to merge, or discard this patch.
Apps/Model/Admin/Content/FormContentRestore.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
     }
21 21
 
22 22
     /**
23
-    * Pass properties
24
-    */
23
+     * Pass properties
24
+     */
25 25
     public function before()
26 26
     {
27 27
         $this->id = $this->_record->id;
@@ -29,8 +29,8 @@  discard block
 block discarded – undo
29 29
     }
30 30
 
31 31
     /**
32
-    * Form label
33
-    */
32
+     * Form label
33
+     */
34 34
     public function labels()
35 35
     {
36 36
         return [
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
     }
40 40
 
41 41
     /**
42
-    * Typical rules
43
-    */
42
+     * Typical rules
43
+     */
44 44
     public function rules()
45 45
     {
46 46
         return [];
Please login to merge, or discard this patch.
Apps/Model/Admin/Content/FormSettings.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
     }
29 29
 
30 30
     /**
31
-    * Set model properties based on defaults config values
32
-    */
31
+     * Set model properties based on defaults config values
32
+     */
33 33
     public function before()
34 34
     {
35 35
         foreach ($this->_configs as $property => $value) {
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
     }
41 41
 
42 42
     /**
43
-    * Form labels
44
-    */
43
+     * Form labels
44
+     */
45 45
     public function labels()
46 46
     {
47 47
         return [
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
     }
58 58
 
59 59
     /**
60
-    * Validation rules
61
-    */
60
+     * Validation rules
61
+     */
62 62
     public function rules()
63 63
     {
64 64
         return [
Please login to merge, or discard this patch.
Apps/Model/Admin/Main/FormAddRoute.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -17,16 +17,16 @@  discard block
 block discarded – undo
17 17
 
18 18
 
19 19
     /**
20
-    * Load default properties into the model
21
-    */
20
+     * Load default properties into the model
21
+     */
22 22
     public function before()
23 23
     {
24 24
         $this->cfg = App::$Properties->getAll('Routing');
25 25
     }
26 26
 
27 27
     /**
28
-    * Define labels for form
29
-    */
28
+     * Define labels for form
29
+     */
30 30
     public function labels()
31 31
     {
32 32
         return [
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
     }
39 39
 
40 40
     /**
41
-    * Define validation rules
42
-    */
41
+     * Define validation rules
42
+     */
43 43
     public function rules()
44 44
     {
45 45
         return [
Please login to merge, or discard this patch.
Apps/Model/Admin/Main/FormSettings.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
27 27
     public $languageDomainAlias;
28 28
 
29 29
     /**
30
-    * Set property values from configurations
31
-    */
30
+     * Set property values from configurations
31
+     */
32 32
     public function before()
33 33
     {
34 34
         // set default values
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
     }
39 39
 
40 40
     /**
41
-    * Set translation helpers
42
-    */
41
+     * Set translation helpers
42
+     */
43 43
     public function labels()
44 44
     {
45 45
         return [
@@ -64,8 +64,8 @@  discard block
 block discarded – undo
64 64
     }
65 65
 
66 66
     /**
67
-    * Validation rules for configuration saving
68
-    */
67
+     * Validation rules for configuration saving
68
+     */
69 69
     public function rules()
70 70
     {
71 71
         return [
Please login to merge, or discard this patch.