Passed
Push — master ( e6812d...2fec17 )
by Mihail
05:18
created
Apps/Controller/Admin/Feedback.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     public function actionIndex()
34 34
     {
35 35
         // set current page and offset
36
-        $page = (int)$this->request->query->get('page');
36
+        $page = (int) $this->request->query->get('page');
37 37
         $offset = $page * self::ITEM_PER_PAGE;
38 38
 
39 39
         // get feedback posts AR table
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 
76 76
         // initialize model with answer add if thread is not closed
77 77
         $model = null;
78
-        if ((int)$record->closed !== 1) {
78
+        if ((int) $record->closed !== 1) {
79 79
             $model = new FormAnswerAdd($record, App::$User->identity()->getId());
80 80
             if ($model->send()) {
81 81
                 if ($model->validate()) {
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
             case 'answer':
116 116
                 $record = FeedbackAnswer::find($id);
117 117
                 if ($record !== null && $record !== false) {
118
-                    $postId = (int)$record->getFeedbackPost()->id;
118
+                    $postId = (int) $record->getFeedbackPost()->id;
119 119
                 }
120 120
                 break;
121 121
         }
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
             if ($model->validate()) {
132 132
                 $model->make();
133 133
                 App::$Session->getFlashBag()->add('success', __('Feedback item are successful changed'));
134
-                $this->response->redirect('feedback/read/' . $postId);
134
+                $this->response->redirect('feedback/read/'.$postId);
135 135
             } else {
136 136
                 App::$Session->getFlashBag()->add('danger', __('Updating is failed'));
137 137
             }
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
         App::$Session->getFlashBag()->add('success', __('Feedback request is changed!'));
182 182
 
183 183
         // redirect to feedback post read
184
-        $this->response->redirect('feedback/read/' . $id);
184
+        $this->response->redirect('feedback/read/'.$id);
185 185
         return null;
186 186
     }
187 187
 
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
                 // its a answer, lets remove it and redirect back in post
227 227
                 $postId = $record->feedback_id;
228 228
                 $record->delete();
229
-                $this->response->redirect('feedback/read/' . $postId);
229
+                $this->response->redirect('feedback/read/'.$postId);
230 230
             }
231 231
         }
232 232
 
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
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
     public function actionDelete($id = null)
105 105
     {
106 106
         // check if id is passed or get data from GET as array ids
107
-        if ($id === 0 || (int)$id < 1) {
107
+        if ($id === 0 || (int) $id < 1) {
108 108
             $ids = $this->request->query->get('selected');
109 109
             if (Obj::isArray($ids) && Arr::onlyNumericValues($ids)) {
110 110
                 $id = $ids;
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
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
         $query = new ProfileRecords();
34 34
 
35 35
         // set current page and offset
36
-        $page = (int)$this->request->query->get('page');
36
+        $page = (int) $this->request->query->get('page');
37 37
         $offset = $page * self::ITEM_PER_PAGE;
38 38
 
39 39
         // build pagination
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      */
61 61
     public function actionDelete($id)
62 62
     {
63
-        $this->response->redirect('user/delete/' . $id);
63
+        $this->response->redirect('user/delete/'.$id);
64 64
     }
65 65
 
66 66
     /**
Please login to merge, or discard this patch.
Apps/Controller/Admin/Main.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -37,21 +37,21 @@  discard block
 block discarded – undo
37 37
         // cache some data
38 38
         $rootSize = App::$Cache->get('root.size');
39 39
         if ($rootSize === null) {
40
-            $rootSize = round(Directory::getSize('/') / (1024*1000), 2) . ' mb';
40
+            $rootSize = round(Directory::getSize('/') / (1024 * 1000), 2).' mb';
41 41
             App::$Cache->set('root.size', $rootSize, 86400); // 24 hours caching = 60 * 60 * 24
42 42
         }
43 43
         $loadAvg = App::$Cache->get('load.average');
44 44
         if ($loadAvg === null) {
45 45
             $loadAvg = Environment::loadAverage();
46
-            App::$Cache->set('load.average', $loadAvg, 60*5); // 5 min cache
46
+            App::$Cache->set('load.average', $loadAvg, 60 * 5); // 5 min cache
47 47
         }
48 48
 
49 49
         // prepare system statistic
50 50
         $stats = [
51
-            'ff_version' => App::$Properties->version['num'] . ' (' . App::$Properties->version['date'] . ')',
52
-            'php_version' => Environment::phpVersion() . ' (' . Environment::phpSAPI() . ')',
51
+            'ff_version' => App::$Properties->version['num'].' ('.App::$Properties->version['date'].')',
52
+            'php_version' => Environment::phpVersion().' ('.Environment::phpSAPI().')',
53 53
             'os_name' => Environment::osName(),
54
-            'database_name' => App::$Database->connection()->getDatabaseName() . ' (' . App::$Database->connection()->getDriverName() . ')',
54
+            'database_name' => App::$Database->connection()->getDatabaseName().' ('.App::$Database->connection()->getDriverName().')',
55 55
             'file_size' => $rootSize,
56 56
             'load_avg' => $loadAvg
57 57
         ];
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
     public function actionFiles()
104 104
     {
105 105
         return $this->view->render('files', [
106
-            'connector' => App::$Alias->scriptUrl . '/api/main/files?lang=' . $this->request->getLanguage()
106
+            'connector' => App::$Alias->scriptUrl.'/api/main/files?lang='.$this->request->getLanguage()
107 107
         ]);
108 108
     }
109 109
 
@@ -174,9 +174,9 @@  discard block
 block discarded – undo
174 174
      */
175 175
     public function actionDeleteroute()
176 176
     {
177
-        $type = (string)$this->request->query->get('type');
178
-        $loader = (string)$this->request->query->get('loader');
179
-        $source = Str::lowerCase((string)$this->request->query->get('path'));
177
+        $type = (string) $this->request->query->get('type');
178
+        $loader = (string) $this->request->query->get('loader');
179
+        $source = Str::lowerCase((string) $this->request->query->get('path'));
180 180
 
181 181
         $model = new EntityDeleteRoute($type, $loader, $source);
182 182
         if ($model->send() && $model->validate()) {
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
     {
200 200
         $stats = App::$Cache->stats();
201 201
         // get size in mb from cache stats
202
-        $size = round((int)$stats['size'] / (1024*1024), 2);
202
+        $size = round((int) $stats['size'] / (1024 * 1024), 2);
203 203
 
204 204
         // check if submited
205 205
         if ($this->request->request->get('clearcache', false)) {
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
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
     public function actionDelete($type, $id = 0)
141 141
     {
142 142
         // sounds like a multiply delete definition
143
-        if ($id === 0 || (int)$id < 1) {
143
+        if ($id === 0 || (int) $id < 1) {
144 144
             $ids = $this->request->query->get('selected');
145 145
             if (Obj::isArray($ids) && Arr::onlyNumericValues($ids)) {
146 146
                 $id = $ids;
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
         if ($model->send() && $model->validate()) {
175 175
             $model->make();
176 176
             App::$Session->getFlashBag()->add('success', __('Comments or answers are successful deleted!'));
177
-            $this->response->redirect('comments/' . ($type === 'answer' ? 'answerlist' : 'index'));
177
+            $this->response->redirect('comments/'.($type === 'answer' ? 'answerlist' : 'index'));
178 178
         }
179 179
 
180 180
         // render view
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
     public function actionPublish($type, $id = 0)
196 196
     {
197 197
         // check if it multiple accept ids
198
-        if ($id === 0 || (int)$id < 1) {
198
+        if ($id === 0 || (int) $id < 1) {
199 199
             $ids = $this->request->query->get('selected');
200 200
             if (Obj::isArray($ids) && Arr::onlyNumericValues($ids)) {
201 201
                 $id = $ids;
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
         if ($model->send()) {
230 230
             $model->make();
231 231
             App::$Session->getFlashBag()->add('success', __('Comments or answers are successful published'));
232
-            $this->response->redirect('comments/' . ($type === 'answer' ? 'answerlist' : 'index'));
232
+            $this->response->redirect('comments/'.($type === 'answer' ? 'answerlist' : 'index'));
233 233
         }
234 234
 
235 235
         return $this->view->render('publish', [
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
     public function actionAnswerlist()
247 247
     {
248 248
         // set current page and offset
249
-        $page = (int)$this->request->query->get('page');
249
+        $page = (int) $this->request->query->get('page');
250 250
         $offset = $page * self::ITEM_PER_PAGE;
251 251
 
252 252
         // initialize ar answers model
Please login to merge, or discard this patch.
Loader/Cron/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 /** set default locale */
15 15
 $_GET['lang'] = 'en';
16 16
 
17
-require_once(root . '/Loader/Autoload.php');
17
+require_once(root.'/Loader/Autoload.php');
18 18
 
19 19
 // make fast-access alias \App::$Object
20 20
 // class_alias('Ffcms\Core\App', 'App');
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     $logs = $cronManager->run();
43 43
     if (PHP_SAPI === 'cli') {
44 44
         if ($logs !== null && \Ffcms\Core\Helper\Type\Obj::isArray($logs) && count($logs) > 0) {
45
-            echo 'Run cron tasks: ' . PHP_EOL . implode(PHP_EOL, $logs);
45
+            echo 'Run cron tasks: '.PHP_EOL.implode(PHP_EOL, $logs);
46 46
         } else {
47 47
             echo 'No tasks runned';
48 48
         }
Please login to merge, or discard this patch.
Extend/Core/Arch/FrontAppController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         }
32 32
 
33 33
         // add localizations
34
-        App::$Translate->append(App::$Alias->currentViewPath . '/I18n/' . App::$Request->getLanguage() . '.php');
34
+        App::$Translate->append(App::$Alias->currentViewPath.'/I18n/'.App::$Request->getLanguage().'.php');
35 35
 
36 36
         parent::__construct();
37 37
     }
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         }
55 55
 
56 56
         // check if disabled (0 = enabled, anything else = on)
57
-        return (int)$this->application->disabled === 0;
57
+        return (int) $this->application->disabled === 0;
58 58
     }
59 59
 
60 60
     /**
@@ -66,10 +66,10 @@  discard block
 block discarded – undo
66 66
         if ($this->configs !== null) {
67 67
             return $this->configs;
68 68
         }
69
-        $configs = (array)unserialize($this->application->configs); // data always stored like a "string" objects
69
+        $configs = (array) unserialize($this->application->configs); // data always stored like a "string" objects
70 70
         foreach ($configs as $cfg => $value) {
71 71
             if (Obj::isLikeInt($value)) {
72
-                $configs[$cfg] = (int)$value; // convert string 1 "1" to int 1 1
72
+                $configs[$cfg] = (int) $value; // convert string 1 "1" to int 1 1
73 73
             }
74 74
         }
75 75
         $this->configs = $configs;
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
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
         }
52 52
 
53 53
         // if widget is disabled - lets return nothing
54
-        return !(bool)$wData->disabled;
54
+        return !(bool) $wData->disabled;
55 55
     }
56 56
 
57 57
 }
58 58
\ No newline at end of file
Please login to merge, or discard this patch.
Apps/View/Front/default/content/list.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 
16 16
 $catConfigs = [];
17 17
 foreach ($model->category['configs'] as $key=>$value) {
18
-    $catConfigs[$key] = (int)$value === 1;
18
+    $catConfigs[$key] = (int) $value === 1;
19 19
 }
20 20
 
21 21
 $catMeta = [
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 <?php foreach ($model->items as $item): ?>
69 69
     <article class="article-item" itemscope="itemscope" itemtype="https://schema.org/NewsArticle">
70 70
         <h2 itemprop="name">
71
-            <a href="<?= \App::$Alias->baseUrl . $item['uri'] ?>">
71
+            <a href="<?= \App::$Alias->baseUrl.$item['uri'] ?>">
72 72
                 <?= $item['title'] ?>
73 73
             </a>
74 74
         </h2>
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
                 <?php
96 96
                 $ownerNick = $item['author']->getProfile()->getNickname();
97 97
                 if ($item['author']->getId() < 1) {
98
-                    echo '<s>' . $ownerNick . '</s>';
98
+                    echo '<s>'.$ownerNick.'</s>';
99 99
                 } else {
100 100
                     echo Url::link(['profile/show', $item['author']->getId()], $ownerNick, ['itemprop' => 'author']);
101 101
                 }
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
         <div class="row">
113 113
             <div class="col-md-12">
114 114
                 <?php if ($catConfigs['showPoster'] === true && $item['thumb'] !== null): ?>
115
-                <img src="<?= \App::$Alias->scriptUrl . $item['thumb'] ?>" class="image_poster img-thumbnail hidden-xs" alt="<?= __('Poster for') ?>: <?= Str::lowerCase($item['title']) ?>" />
115
+                <img src="<?= \App::$Alias->scriptUrl.$item['thumb'] ?>" class="image_poster img-thumbnail hidden-xs" alt="<?= __('Poster for') ?>: <?= Str::lowerCase($item['title']) ?>" />
116 116
                 <?php endif; ?>
117 117
                 <div itemprop="text articleBody">
118 118
                     <?= $item['text'] ?>
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
             </div>
121 121
         </div>
122 122
         <div class="meta">
123
-        	<?php if ((int)$catConfigs['showRating'] === 1) {
123
+        	<?php if ((int) $catConfigs['showRating'] === 1) {
124 124
         	    echo \App::$View->render('content/_rate', [
125 125
         	        'id' => $item['id'],
126 126
         	        'canRate' => $item['canRate'],
@@ -129,15 +129,15 @@  discard block
 block discarded – undo
129 129
         	} ?>
130 130
 
131 131
         	<span class="spaced hidden-xs"><i class="fa fa-comments"></i>
132
-                <a href="<?= \App::$Alias->baseUrl . $item['uri'] ?>#comments-list"><?= __('Comments') ?>: <span itemprop="commentCount" id="comment-count-<?= $item['id'] ?>">0</span></a>
132
+                <a href="<?= \App::$Alias->baseUrl.$item['uri'] ?>#comments-list"><?= __('Comments') ?>: <span itemprop="commentCount" id="comment-count-<?= $item['id'] ?>">0</span></a>
133 133
             </span>
134 134
             <span class="pull-right">
135
-            <?php if ((int)$catConfigs['showTags'] === 1 && $item['tags'] !== null && Obj::isArray($item['tags'])): ?>
135
+            <?php if ((int) $catConfigs['showTags'] === 1 && $item['tags'] !== null && Obj::isArray($item['tags'])): ?>
136 136
                 <span class="spaced"><i class="fa fa-tags hidden-xs"></i>
137 137
                 <?php
138 138
                     foreach ($item['tags'] as $tag) {
139 139
                         $tag = \App::$Security->strip_tags(trim($tag));
140
-                        echo Url::link(['content/tag', $tag], $tag, ['class' => 'label label-default']) . "&nbsp;";
140
+                        echo Url::link(['content/tag', $tag], $tag, ['class' => 'label label-default'])."&nbsp;";
141 141
                     }
142 142
                 ?>
143 143
                 </span>
Please login to merge, or discard this patch.