Passed
Push — develop ( b0d4d9...a04106 )
by Andrew
03:35
created
src/controllers/ChartsController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
                 ])
80 80
                 ->where(['between', 'dateUpdated', $start, $end])
81 81
                 ->andWhere(['not', [$column => null]]);
82
-            if ((int)$siteId !== 0) {
82
+            if ((int) $siteId !== 0) {
83 83
                 $query->andWhere(['siteId' => $siteId]);
84 84
             }
85 85
             if ($pageUrl !== '') {
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
                 ])
97 97
                 ->where(['between', 'dateUpdated', $start, $end])
98 98
                 ->andWhere(['not', [$column => null]]);
99
-            if ((int)$siteId !== 0) {
99
+            if ((int) $siteId !== 0) {
100 100
                 $query->andWhere(['siteId' => $siteId]);
101 101
             }
102 102
             $stats = $query->all();
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
         // Massage the data
105 105
         if ($stats) {
106 106
             foreach ($stats as &$stat) {
107
-                $stat['cnt'] = (int)$stat['cnt'];
107
+                $stat['cnt'] = (int) $stat['cnt'];
108 108
             }
109 109
             $data = $stats[0];
110 110
         }
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
                 ])
151 151
                 ->where(['between', 'dateUpdated', $start, $end])
152 152
                 ->andWhere(['not', [$column => null]]);
153
-            if ((int)$siteId !== 0) {
153
+            if ((int) $siteId !== 0) {
154 154
                 $query->andWhere(['siteId' => $siteId]);
155 155
             }
156 156
             $query
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
                 ])
172 172
                 ->where(['between', 'dateUpdated', $start, $end])
173 173
                 ->andWhere(['not', [$column => null]]);
174
-            if ((int)$siteId !== 0) {
174
+            if ((int) $siteId !== 0) {
175 175
                 $query->andWhere(['siteId' => $siteId]);
176 176
             }
177 177
             $query
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
         // Massage the data
184 184
         if ($stats) {
185 185
             foreach ($stats as &$stat) {
186
-                $stat['cnt'] = (int)$stat['cnt'];
186
+                $stat['cnt'] = (int) $stat['cnt'];
187 187
                 $stat['detailPageUrl'] = UrlHelper::cpUrl('webperf/page-detail', [
188 188
                     'pageUrl' => $stat['url'],
189 189
                     'siteId' => $siteId,
Please login to merge, or discard this patch.
src/controllers/TablesController.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@
 block discarded – undo
124 124
             // Compute the largest page load time
125 125
             $maxTotalPageLoad = 0;
126 126
             foreach ($stats as &$stat) {
127
-             // Determine the stat type
127
+                // Determine the stat type
128 128
                 if (!empty($stat['pageLoad']) && !empty($stat['craftTotalMs'])) {
129 129
                     $stat['type'] = 'both';
130 130
                 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
             ->offset($offset)
104 104
             ->where(['between', 'dateUpdated', $start, $end])
105 105
         ;
106
-        if ((int)$siteId !== 0) {
106
+        if ((int) $siteId !== 0) {
107 107
             $query->andWhere(['siteId' => $siteId]);
108 108
         }
109 109
         if ($filter !== '') {
@@ -142,8 +142,8 @@  discard block
 block discarded – undo
142 142
             $index = 1;
143 143
             foreach ($stats as &$stat) {
144 144
                 $stat['id'] = $index++;
145
-                $stat['cnt'] = (int)$stat['cnt'];
146
-                $stat['maxTotalPageLoad'] = (int)$maxTotalPageLoad;
145
+                $stat['cnt'] = (int) $stat['cnt'];
146
+                $stat['maxTotalPageLoad'] = (int) $maxTotalPageLoad;
147 147
                 // Decode any emojis in the title
148 148
                 if (!empty($stat['title'])) {
149 149
                     $stat['title'] = html_entity_decode($stat['title'], ENT_NOQUOTES, 'UTF-8');
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
             ->where(['url' => $pageUrl])
241 241
             ->andWhere(['between', 'dateUpdated', $start, $end])
242 242
         ;
243
-        if ((int)$siteId !== 0) {
243
+        if ((int) $siteId !== 0) {
244 244
             $query->andWhere(['siteId' => $siteId]);
245 245
         }
246 246
         if ($filter !== '') {
@@ -272,12 +272,12 @@  discard block
 block discarded – undo
272 272
                     $stat['type'] = 'frontend';
273 273
                 }
274 274
                 if ($stat['pageLoad'] > $maxTotalPageLoad) {
275
-                    $maxTotalPageLoad = (int)$stat['pageLoad'];
275
+                    $maxTotalPageLoad = (int) $stat['pageLoad'];
276 276
                 }
277 277
             }
278 278
             // Massage the stats
279 279
             foreach ($stats as &$stat) {
280
-                $stat['maxTotalPageLoad'] = (int)$maxTotalPageLoad;
280
+                $stat['maxTotalPageLoad'] = (int) $maxTotalPageLoad;
281 281
                 // Decode any emojis in the title
282 282
                 if (!empty($stat['title'])) {
283 283
                     $stat['title'] = html_entity_decode($stat['title'], ENT_NOQUOTES, 'UTF-8');
Please login to merge, or discard this patch.
src/services/Beacons.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
     {
142 142
         $stats = Webperf::$plugin->profileTarget->stats;
143 143
         $request = Craft::$app->getRequest();
144
-        $pageLoad = (int)($stats['database']['duration']
144
+        $pageLoad = (int) ($stats['database']['duration']
145 145
             + $stats['twig']['duration']
146 146
             + $stats['other']['duration']);
147 147
         // Allocate a new DataSample, and fill it in
@@ -151,13 +151,13 @@  discard block
 block discarded – undo
151 151
             'queryString' => $request->getQueryString(),
152 152
             'pageLoad' => $pageLoad,
153 153
             'craftTotalMs' => $pageLoad,
154
-            'craftDbMs' => (int)$stats['database']['duration'],
155
-            'craftDbCnt' => (int)$stats['database']['count'],
156
-            'craftTwigMs' => (int)$stats['twig']['duration'],
157
-            'craftTwigCnt' => (int)$stats['twig']['count'],
158
-            'craftOtherMs' => (int)$stats['other']['duration'],
159
-            'craftOtherCnt' => (int)$stats['other']['count'],
160
-            'craftTotalMemory' => (int)($stats['database']['memory']
154
+            'craftDbMs' => (int) $stats['database']['duration'],
155
+            'craftDbCnt' => (int) $stats['database']['count'],
156
+            'craftTwigMs' => (int) $stats['twig']['duration'],
157
+            'craftTwigCnt' => (int) $stats['twig']['count'],
158
+            'craftOtherMs' => (int) $stats['other']['duration'],
159
+            'craftOtherCnt' => (int) $stats['other']['count'],
160
+            'craftTotalMemory' => (int) ($stats['database']['memory']
161 161
                 + $stats['twig']['memory']
162 162
                 + $stats['other']['memory']),
163 163
         ]);
Please login to merge, or discard this patch.