Passed
Push — develop ( 8ffe0f...cc57ca )
by Andrew
03:26
created
src/migrations/Install.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
         return true;
52 52
     }
53 53
 
54
-   /**
54
+    /**
55 55
      * @inheritdoc
56 56
      */
57 57
     public function safeDown()
Please login to merge, or discard this patch.
src/variables/ManifestVariable.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
         self::$config['server']['publicPath'] = $baseAssetsUrl;
52 52
         $useDevServer = getenv('NYS_PLUGIN_DEVSERVER');
53 53
         if ($useDevServer !== false) {
54
-            self::$config['useDevServer'] = (bool)$useDevServer;
54
+            self::$config['useDevServer'] = (bool) $useDevServer;
55 55
         }
56 56
     }
57 57
 
Please login to merge, or discard this patch.
src/helpers/Manifest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
         $cache = Craft::$app->getCache();
406 406
         $file = $cache->getOrSet(
407 407
             self::CACHE_KEY.$path,
408
-            function () use ($path, $callback) {
408
+            function() use ($path, $callback) {
409 409
                 $result = null;
410 410
                 $contents = @file_get_contents($path);
411 411
                 if ($contents) {
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
     protected static function combinePaths(string ...$paths): string
436 436
     {
437 437
         $last_key = \count($paths) - 1;
438
-        array_walk($paths, function (&$val, $key) use ($last_key) {
438
+        array_walk($paths, function(&$val, $key) use ($last_key) {
439 439
             switch ($key) {
440 440
                 case 0:
441 441
                     $val = rtrim($val, '/ ');
Please login to merge, or discard this patch.
src/helpers/Text.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
         if (!empty($string)) {
44 44
             $string = strip_tags($string);
45
-            $result = (string)Stringy::create($string)->truncate($length, $substring);
45
+            $result = (string) Stringy::create($string)->truncate($length, $substring);
46 46
         }
47 47
 
48 48
         return $result;
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 
67 67
         if (!empty($string)) {
68 68
             $string = strip_tags($string);
69
-            $result = (string)Stringy::create($string)->safeTruncate($length, $substring);
69
+            $result = (string) Stringy::create($string)->safeTruncate($length, $substring);
70 70
         }
71 71
 
72 72
         return $result;
Please login to merge, or discard this patch.
src/helpers/MultiSite.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
             } else {
113 113
                 $variables['sitesMenuLabel'] = Craft::t(
114 114
                     'site',
115
-                    $sites->getSiteById((int)$variables['currentSiteId'])->name
115
+                    $sites->getSiteById((int) $variables['currentSiteId'])->name
116 116
                 );
117 117
             }
118 118
         } else {
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
             }
173 173
 
174 174
             if (($parsed = parse_url(self::getBaseUrl($site))) === false) {
175
-                Craft::warning('Unable to parse the site base URL: ' . $site->baseUrl);
175
+                Craft::warning('Unable to parse the site base URL: '.$site->baseUrl);
176 176
                 continue;
177 177
             }
178 178
 
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 
184 184
             // Does the site URL specify a base path?
185 185
             $parsedPath = !empty($parsed['path']) ? self::normalizePath($parsed['path']) : '';
186
-            if ($parsedPath && strpos($fullUri . '/', $parsedPath . '/') !== 0) {
186
+            if ($parsedPath && strpos($fullUri.'/', $parsedPath.'/') !== 0) {
187 187
                 continue;
188 188
             }
189 189
 
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
     protected static function getBaseUrl(Site $site): string
258 258
     {
259 259
         if ($site->baseUrl) {
260
-            return rtrim(self::parseEnv($site->baseUrl), '/') . '/';
260
+            return rtrim(self::parseEnv($site->baseUrl), '/').'/';
261 261
         }
262 262
 
263 263
         return null;
Please login to merge, or discard this patch.
src/Webperf.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
         Event::on(
205 205
             Plugins::class,
206 206
             Plugins::EVENT_AFTER_INSTALL_PLUGIN,
207
-            function (PluginEvent $event) {
207
+            function(PluginEvent $event) {
208 208
                 if ($event->plugin === $this) {
209 209
                     // Invalidate our caches after we've been installed
210 210
                     $this->clearAllCaches();
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
         Event::on(
233 233
             CraftVariable::class,
234 234
             CraftVariable::EVENT_INIT,
235
-            function (Event $event) {
235
+            function(Event $event) {
236 236
                 /** @var CraftVariable $variable */
237 237
                 $variable = $event->sender;
238 238
                 $variable->set('webperf', WebperfVariable::class);
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
         Event::on(
243 243
             Plugins::class,
244 244
             Plugins::EVENT_AFTER_LOAD_PLUGINS,
245
-            function () {
245
+            function() {
246 246
                 // Install these only after all other plugins have loaded
247 247
                 $request = Craft::$app->getRequest();
248 248
                 // Only respond to non-console site requests
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
         Event::on(
267 267
             UrlManager::class,
268 268
             UrlManager::EVENT_REGISTER_SITE_URL_RULES,
269
-            function (RegisterUrlRulesEvent $event) {
269
+            function(RegisterUrlRulesEvent $event) {
270 270
                 Craft::debug(
271 271
                     'UrlManager::EVENT_REGISTER_SITE_URL_RULES',
272 272
                     __METHOD__
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
         Event::on(
290 290
             UrlManager::class,
291 291
             UrlManager::EVENT_REGISTER_CP_URL_RULES,
292
-            function (RegisterUrlRulesEvent $event) {
292
+            function(RegisterUrlRulesEvent $event) {
293 293
                 Craft::debug(
294 294
                     'UrlManager::EVENT_REGISTER_CP_URL_RULES',
295 295
                     __METHOD__
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
         Event::on(
306 306
             Dashboard::class,
307 307
             Dashboard::EVENT_REGISTER_WIDGET_TYPES,
308
-            function (RegisterComponentTypesEvent $event) {
308
+            function(RegisterComponentTypesEvent $event) {
309 309
                 $event->types[] = MetricsWidget::class;
310 310
             }
311 311
         );
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
         Event::on(
314 314
             UserPermissions::class,
315 315
             UserPermissions::EVENT_REGISTER_PERMISSIONS,
316
-            function (RegisterUserPermissionsEvent $event) {
316
+            function(RegisterUserPermissionsEvent $event) {
317 317
                 Craft::debug(
318 318
                     'UserPermissions::EVENT_REGISTER_PERMISSIONS',
319 319
                     __METHOD__
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
             Event::on(
339 339
                 View::class,
340 340
                 View::EVENT_END_PAGE,
341
-                function () {
341
+                function() {
342 342
                     Craft::debug(
343 343
                         'View::EVENT_END_PAGE',
344 344
                         __METHOD__
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
             Event::on(
363 363
                 View::class,
364 364
                 View::EVENT_END_BODY,
365
-                function () {
365
+                function() {
366 366
                     Craft::debug(
367 367
                         'View::EVENT_END_BODY',
368 368
                         __METHOD__
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
             Event::on(
386 386
                 Application::class,
387 387
                 Application::EVENT_AFTER_REQUEST,
388
-                function () {
388
+                function() {
389 389
                     Craft::debug(
390 390
                         'Application::EVENT_AFTER_REQUEST',
391 391
                         __METHOD__
Please login to merge, or discard this patch.
src/helpers/PluginTemplate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
 
74 74
         // Render the template with our vars passed in
75 75
         try {
76
-            $htmlText = Craft::$app->view->renderTemplate('webperf/' . $templatePath, $params);
76
+            $htmlText = Craft::$app->view->renderTemplate('webperf/'.$templatePath, $params);
77 77
             if ($minifier) {
78 78
                 // If SEOmatic is installed, get the title from it
79 79
                 $minify = Craft::$app->getPlugins()->getPlugin(self::MINIFY_PLUGIN_HANDLE);
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   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
             ->offset($offset)
105 105
             ->where(['between', 'dateCreated', $start, $end])
106 106
         ;
107
-        if ((int)$siteId !== 0) {
107
+        if ((int) $siteId !== 0) {
108 108
             $query->andWhere(['siteId' => $siteId]);
109 109
         }
110 110
         if ($filter !== '') {
@@ -143,8 +143,8 @@  discard block
 block discarded – undo
143 143
             $index = 1;
144 144
             foreach ($stats as &$stat) {
145 145
                 $stat['id'] = $index++;
146
-                $stat['cnt'] = (int)$stat['cnt'];
147
-                $stat['maxTotalPageLoad'] = (int)$maxTotalPageLoad;
146
+                $stat['cnt'] = (int) $stat['cnt'];
147
+                $stat['maxTotalPageLoad'] = (int) $maxTotalPageLoad;
148 148
                 // Decode any emojis in the title
149 149
                 if (!empty($stat['title'])) {
150 150
                     $stat['title'] = html_entity_decode($stat['title'], ENT_NOQUOTES, 'UTF-8');
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
             ->where(['url' => $pageUrl])
242 242
             ->andWhere(['between', 'dateCreated', $start, $end])
243 243
         ;
244
-        if ((int)$siteId !== 0) {
244
+        if ((int) $siteId !== 0) {
245 245
             $query->andWhere(['siteId' => $siteId]);
246 246
         }
247 247
         if ($filter !== '') {
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
                     $stat['type'] = 'frontend';
274 274
                 }
275 275
                 if ($stat['pageLoad'] > $maxTotalPageLoad) {
276
-                    $maxTotalPageLoad = (int)$stat['pageLoad'];
276
+                    $maxTotalPageLoad = (int) $stat['pageLoad'];
277 277
                 }
278 278
             }
279 279
             // Massage the stats
@@ -282,8 +282,8 @@  discard block
 block discarded – undo
282 282
                     $date = DateTimeHelper::toDateTime($stats['dateCreated']);
283 283
                     $stats['dateCreated'] = $date->format('Y-m-d H:i:s');
284 284
                 }
285
-                $stat['mobile'] = (bool)$stat['mobile'];
286
-                $stat['maxTotalPageLoad'] = (int)$maxTotalPageLoad;
285
+                $stat['mobile'] = (bool) $stat['mobile'];
286
+                $stat['maxTotalPageLoad'] = (int) $maxTotalPageLoad;
287 287
                 // Decode any emojis in the title
288 288
                 if (!empty($stat['title'])) {
289 289
                     $stat['title'] = html_entity_decode($stat['title'], ENT_NOQUOTES, 'UTF-8');
Please login to merge, or discard this patch.
src/controllers/MetricsController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -161,8 +161,8 @@  discard block
 block discarded – undo
161 161
             if ($userAgent) {
162 162
                 $parser = new Parser($userAgent);
163 163
                 $sample->device = $parser->device->model;
164
-                $sample->browser = $parser->browser->name . ' ' . $parser->browser->getVersion();
165
-                $sample->os = $parser->os->name . ' ' . $parser->os->getVersion();
164
+                $sample->browser = $parser->browser->name.' '.$parser->browser->getVersion();
165
+                $sample->os = $parser->os->name.' '.$parser->os->getVersion();
166 166
                 $sample->mobile = $parser->isMobile();
167 167
             }
168 168
             // Save the data sample
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
             $now = round(microtime(true) * 1000);
188 188
             $cache = Craft::$app->getCache();
189 189
             $then = $cache->get(self::LAST_BEACON_CACHE_KEY);
190
-            if (($then !== false) && ($now - (int)$then < Webperf::$settings->rateLimitMs)) {
190
+            if (($then !== false) && ($now - (int) $then < Webperf::$settings->rateLimitMs)) {
191 191
                 $limited = true;
192 192
                 Craft::warning('Beacon ignored due to rate limiting', __METHOD__);
193 193
             }
Please login to merge, or discard this patch.