Passed
Push — develop ( 2fe9f2...3da191 )
by Andrew
03:21
created
src/services/Recommendations.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@
 block discarded – undo
107 107
         if (!empty($pageUrl)) {
108 108
             $query->andWhere(['url' => $pageUrl]);
109 109
         }
110
-        if ((int)$siteId !== 0) {
110
+        if ((int) $siteId !== 0) {
111 111
             $query->andWhere(['siteId' => $siteId]);
112 112
         }
113 113
         $stats = $query->all();
Please login to merge, or discard this patch.
src/recommendations/MemoryLimit.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,10 +38,10 @@
 block discarded – undo
38 38
         $phpMemoryLimit = $this->memoryLimit();
39 39
         if ($phpMemoryLimit && $this->sample->craftTotalMemory) {
40 40
             $ratio = $phpMemoryLimit / $this->sample->craftTotalMemory;
41
-            $displayCraftTotalMemory = (($this->sample->craftTotalMemory / 1024) / 1024) . 'M';
42
-            $displayPhpMemoryLimit = (($phpMemoryLimit / 1024) / 1024) . 'M';
43
-            $displayCraftMinMemory = ((self::MIN_CRAFT_MEMORY / 1024) / 1024) . 'M';
44
-            $displayCraftMaxMemory = ((self::MAX_CRAFT_MEMORY / 1024) / 1024) . 'M';
41
+            $displayCraftTotalMemory = (($this->sample->craftTotalMemory / 1024) / 1024).'M';
42
+            $displayPhpMemoryLimit = (($phpMemoryLimit / 1024) / 1024).'M';
43
+            $displayCraftMinMemory = ((self::MIN_CRAFT_MEMORY / 1024) / 1024).'M';
44
+            $displayCraftMaxMemory = ((self::MAX_CRAFT_MEMORY / 1024) / 1024).'M';
45 45
             $this->summary = Craft::t(
46 46
                 'webperf',
47 47
                 'Check the `memory_limit` setting in your `php.ini` file',
Please login to merge, or discard this patch.
src/services/DataSamples.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
             ->from(['{{%webperf_data_samples}}'])
49 49
             ->where(['not', [$column => null]])
50 50
             ;
51
-        if ((int)$siteId !== 0) {
51
+        if ((int) $siteId !== 0) {
52 52
             $query->andWhere(['siteId' => $siteId]);
53 53
         }
54 54
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
                 ['not', ['title' => '']],
75 75
             ])
76 76
         ;
77
-        if ((int)$siteId !== 0) {
77
+        if ((int) $siteId !== 0) {
78 78
             $query->andWhere(['siteId' => $siteId]);
79 79
         }
80 80
         $result = $query->one();
Please login to merge, or discard this patch.
src/base/Recommendation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,6 +45,6 @@
 block discarded – undo
45 45
      */
46 46
     public function displayMs(int $number): string
47 47
     {
48
-        return number_format((float)$number / 1000, 2).'s';
48
+        return number_format((float) $number / 1000, 2).'s';
49 49
     }
50 50
 }
Please login to merge, or discard this patch.
src/services/ErrorSamples.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
             ->from(['{{%webperf_error_samples}}'])
46 46
             ->where(['not', [$column => null]])
47 47
             ;
48
-        if ((int)$siteId !== 0) {
48
+        if ((int) $siteId !== 0) {
49 49
             $query->andWhere(['siteId' => $siteId]);
50 50
         }
51 51
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
                 ['not', ['title' => '']],
72 72
             ])
73 73
         ;
74
-        if ((int)$siteId !== 0) {
74
+        if ((int) $siteId !== 0) {
75 75
             $query->andWhere(['siteId' => $siteId]);
76 76
         }
77 77
         $result = $query->one();
Please login to merge, or discard this patch.
src/Webperf.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
         $navItem = parent::getCpNavItem();
155 155
         $cache = Craft::$app->getCache();
156 156
         // See if there are any recommendations to add as a badge
157
-        $recommendations = $cache->getOrSet(self::RECOMMENDATIONS_CACHE_KEY, function () {
157
+        $recommendations = $cache->getOrSet(self::RECOMMENDATIONS_CACHE_KEY, function() {
158 158
             $data = [];
159 159
             $now = new \DateTime();
160 160
             $end = $now->format('Y-m-d');
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
                 try {
238 238
                     $this->set('errorsTarget', [
239 239
                         'class' => ErrorsTarget::class,
240
-                        'levels' => ['error','warning'],
240
+                        'levels' => ['error', 'warning'],
241 241
                         'categories' => [],
242 242
                         'logVars' => [],
243 243
                         'except' => $except,
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
         Event::on(
288 288
             Plugins::class,
289 289
             Plugins::EVENT_AFTER_INSTALL_PLUGIN,
290
-            function (PluginEvent $event) {
290
+            function(PluginEvent $event) {
291 291
                 if ($event->plugin === $this) {
292 292
                     // Invalidate our caches after we've been installed
293 293
                     $this->clearAllCaches();
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
         Event::on(
316 316
             CraftVariable::class,
317 317
             CraftVariable::EVENT_INIT,
318
-            function (Event $event) {
318
+            function(Event $event) {
319 319
                 /** @var CraftVariable $variable */
320 320
                 $variable = $event->sender;
321 321
                 $variable->set('webperf', WebperfVariable::class);
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
         Event::on(
326 326
             Plugins::class,
327 327
             Plugins::EVENT_AFTER_LOAD_PLUGINS,
328
-            function () {
328
+            function() {
329 329
                 // Install these only after all other plugins have loaded
330 330
                 $request = Craft::$app->getRequest();
331 331
                 // Only respond to non-console site requests
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
         Event::on(
350 350
             UrlManager::class,
351 351
             UrlManager::EVENT_REGISTER_SITE_URL_RULES,
352
-            function (RegisterUrlRulesEvent $event) {
352
+            function(RegisterUrlRulesEvent $event) {
353 353
                 Craft::debug(
354 354
                     'UrlManager::EVENT_REGISTER_SITE_URL_RULES',
355 355
                     __METHOD__
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
         Event::on(
373 373
             UrlManager::class,
374 374
             UrlManager::EVENT_REGISTER_CP_URL_RULES,
375
-            function (RegisterUrlRulesEvent $event) {
375
+            function(RegisterUrlRulesEvent $event) {
376 376
                 Craft::debug(
377 377
                     'UrlManager::EVENT_REGISTER_CP_URL_RULES',
378 378
                     __METHOD__
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
         Event::on(
389 389
             Dashboard::class,
390 390
             Dashboard::EVENT_REGISTER_WIDGET_TYPES,
391
-            function (RegisterComponentTypesEvent $event) {
391
+            function(RegisterComponentTypesEvent $event) {
392 392
                 $event->types[] = MetricsWidget::class;
393 393
             }
394 394
         );
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
         Event::on(
397 397
             UserPermissions::class,
398 398
             UserPermissions::EVENT_REGISTER_PERMISSIONS,
399
-            function (RegisterUserPermissionsEvent $event) {
399
+            function(RegisterUserPermissionsEvent $event) {
400 400
                 Craft::debug(
401 401
                     'UserPermissions::EVENT_REGISTER_PERMISSIONS',
402 402
                     __METHOD__
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
             Event::on(
422 422
                 View::class,
423 423
                 View::EVENT_END_PAGE,
424
-                function () {
424
+                function() {
425 425
                     Craft::debug(
426 426
                         'View::EVENT_END_PAGE',
427 427
                         __METHOD__
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
             Event::on(
446 446
                 View::class,
447 447
                 View::EVENT_END_BODY,
448
-                function () {
448
+                function() {
449 449
                     Craft::debug(
450 450
                         'View::EVENT_END_BODY',
451 451
                         __METHOD__
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
             Event::on(
469 469
                 Application::class,
470 470
                 Application::EVENT_AFTER_REQUEST,
471
-                function () {
471
+                function() {
472 472
                     Craft::debug(
473 473
                         'Application::EVENT_AFTER_REQUEST',
474 474
                         __METHOD__
Please login to merge, or discard this patch.
src/controllers/ChartsController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
             ])
82 82
             ->where(['between', 'dateCreated', $start, $end])
83 83
             ->andWhere(['not', [$column => null]]);
84
-        if ((int)$siteId !== 0) {
84
+        if ((int) $siteId !== 0) {
85 85
             $query->andWhere(['siteId' => $siteId]);
86 86
         }
87 87
         if ($pageUrl !== '') {
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         // Massage the data
92 92
         if ($stats) {
93 93
             foreach ($stats as &$stat) {
94
-                $stat['cnt'] = (int)$stat['cnt'];
94
+                $stat['cnt'] = (int) $stat['cnt'];
95 95
             }
96 96
             $data = $stats[0];
97 97
         }
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
             ])
137 137
             ->where(['between', 'dateCreated', $start, $end])
138 138
             ->andWhere(['not', [$column => null]]);
139
-        if ((int)$siteId !== 0) {
139
+        if ((int) $siteId !== 0) {
140 140
             $query->andWhere(['siteId' => $siteId]);
141 141
         }
142 142
         $query
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
         // Massage the data
148 148
         if ($stats) {
149 149
             foreach ($stats as &$stat) {
150
-                $stat['cnt'] = (int)$stat['cnt'];
150
+                $stat['cnt'] = (int) $stat['cnt'];
151 151
                 $stat['detailPageUrl'] = UrlHelper::cpUrl('webperf/performance/page-detail', [
152 152
                     'pageUrl' => $stat['url'],
153 153
                     'siteId' => $siteId,
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
             ])
219 219
             ->where(['between', 'dateCreated', $start, $end])
220 220
             ;
221
-        if ((int)$siteId !== 0) {
221
+        if ((int) $siteId !== 0) {
222 222
             $query->andWhere(['siteId' => $siteId]);
223 223
         }
224 224
         if ($pageUrl !== '') {
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
             ])
348 348
             ->where(['between', 'dateCreated', $start, $end])
349 349
         ;
350
-        if ((int)$siteId !== 0) {
350
+        if ((int) $siteId !== 0) {
351 351
             $query->andWhere(['siteId' => $siteId]);
352 352
         }
353 353
         if ($pageUrl !== '') {
@@ -386,11 +386,11 @@  discard block
 block discarded – undo
386 386
             foreach ($stats as $stat) {
387 387
                 switch ($stat['type']) {
388 388
                     case 'boomerang':
389
-                        $boomerangErrors['data'][] = (int)$stat['cnt'];
389
+                        $boomerangErrors['data'][] = (int) $stat['cnt'];
390 390
                         $boomerangErrors['labels'][] = $stat['sampleDate'];
391 391
                         break;
392 392
                     case 'craft':
393
-                        $craftErrors['data'][] = (int)$stat['cnt'];
393
+                        $craftErrors['data'][] = (int) $stat['cnt'];
394 394
                         $craftErrors['labels'][] = $stat['sampleDate'];
395 395
                         break;
396 396
                 }
Please login to merge, or discard this patch.