Passed
Push — develop ( a3ed87...277eb8 )
by Andrew
03:05
created
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/PluginTemplate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
 
64 64
         // Render the template with our vars passed in
65 65
         try {
66
-            $htmlText = Craft::$app->view->renderTemplate('webperf/' . $templatePath, $params);
66
+            $htmlText = Craft::$app->view->renderTemplate('webperf/'.$templatePath, $params);
67 67
             $templateRendered = true;
68 68
         } catch (\Exception $e) {
69 69
             $htmlText = Craft::t(
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/controllers/TablesController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
             ->offset($offset)
80 80
             ->limit($per_page)
81 81
             ->orderBy("{$sortField} {$sortType}");
82
-        if ((int)$siteId !== 0) {
82
+        if ((int) $siteId !== 0) {
83 83
             $query->where(['siteId' => $siteId]);
84 84
         }
85 85
         if ($filter !== '') {
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
             ->offset($offset)
161 161
             ->limit($per_page)
162 162
             ->orderBy("{$sortField} {$sortType}");
163
-        if ((int)$siteId !== 0) {
163
+        if ((int) $siteId !== 0) {
164 164
             $query->where(['siteId' => $siteId]);
165 165
         }
166 166
         if ($filter !== '') {
Please login to merge, or discard this patch.
src/controllers/MetricsController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 
11 11
 namespace {
12 12
 
13
-    require_once __DIR__ . '/../lib/geoiploc.php';
13
+    require_once __DIR__.'/../lib/geoiploc.php';
14 14
 }
15 15
 
16 16
 namespace nystudio107\webperf\controllers {
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/controllers/ChartsController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
                     'AVG('.$column.') AS avg',
83 83
                 ])
84 84
                 ->where("dateUpdated >= ( CURDATE() - INTERVAL '{$days}' DAY )");
85
-            if ((int)$siteId !== 0) {
85
+            if ((int) $siteId !== 0) {
86 86
                 $query->andWhere(['siteId' => $siteId]);
87 87
             }
88 88
             $stats = $query->all();
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
                     'AVG("'.$column.'") AS avg',
96 96
                 ])
97 97
                 ->where("\"dateUpdated\" >= ( CURRENT_TIMESTAMP - INTERVAL '{$days} days' )");
98
-            if ((int)$siteId !== 0) {
98
+            if ((int) $siteId !== 0) {
99 99
                 $query->andWhere(['siteId' => $siteId]);
100 100
             }
101 101
             $stats = $query->all();
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
                     'AVG('.$column.') AS avg',
152 152
                 ])
153 153
                 ->where("dateUpdated >= ( CURDATE() - INTERVAL '{$days}' DAY )");
154
-            if ((int)$siteId !== 0) {
154
+            if ((int) $siteId !== 0) {
155 155
                 $query->andWhere(['siteId' => $siteId]);
156 156
             }
157 157
             $query
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
                     'AVG("'.$column.'") AS avg',
171 171
                 ])
172 172
                 ->where("\"dateUpdated\" >= ( CURRENT_TIMESTAMP - INTERVAL '{$days} days' )");
173
-            if ((int)$siteId !== 0) {
173
+            if ((int) $siteId !== 0) {
174 174
                 $query->andWhere(['siteId' => $siteId]);
175 175
                 $query
176 176
                     ->orderBy('avg DESC')
@@ -230,8 +230,8 @@  discard block
 block discarded – undo
230 230
         }
231 231
         if ($stats) {
232 232
             $data = [
233
-                (int)$stats,
234
-                (int)$handledStats,
233
+                (int) $stats,
234
+                (int) $handledStats,
235 235
             ];
236 236
         }
237 237
 
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
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
         Event::on(
178 178
             Plugins::class,
179 179
             Plugins::EVENT_AFTER_INSTALL_PLUGIN,
180
-            function (PluginEvent $event) {
180
+            function(PluginEvent $event) {
181 181
                 if ($event->plugin === $this) {
182 182
                     // Invalidate our caches after we've been installed
183 183
                     $this->clearAllCaches();
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
         Event::on(
206 206
             CraftVariable::class,
207 207
             CraftVariable::EVENT_INIT,
208
-            function (Event $event) {
208
+            function(Event $event) {
209 209
                 /** @var CraftVariable $variable */
210 210
                 $variable = $event->sender;
211 211
                 $variable->set('webperf', WebperfVariable::class);
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
         Event::on(
216 216
             Plugins::class,
217 217
             Plugins::EVENT_AFTER_LOAD_PLUGINS,
218
-            function () {
218
+            function() {
219 219
                 // Install these only after all other plugins have loaded
220 220
                 $request = Craft::$app->getRequest();
221 221
                 // Only respond to non-console site requests
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
         Event::on(
240 240
             UrlManager::class,
241 241
             UrlManager::EVENT_REGISTER_SITE_URL_RULES,
242
-            function (RegisterUrlRulesEvent $event) {
242
+            function(RegisterUrlRulesEvent $event) {
243 243
                 Craft::debug(
244 244
                     'UrlManager::EVENT_REGISTER_SITE_URL_RULES',
245 245
                     __METHOD__
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
         Event::on(
263 263
             UrlManager::class,
264 264
             UrlManager::EVENT_REGISTER_CP_URL_RULES,
265
-            function (RegisterUrlRulesEvent $event) {
265
+            function(RegisterUrlRulesEvent $event) {
266 266
                 Craft::debug(
267 267
                     'UrlManager::EVENT_REGISTER_CP_URL_RULES',
268 268
                     __METHOD__
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
         Event::on(
279 279
             Dashboard::class,
280 280
             Dashboard::EVENT_REGISTER_WIDGET_TYPES,
281
-            function (RegisterComponentTypesEvent $event) {
281
+            function(RegisterComponentTypesEvent $event) {
282 282
                 $event->types[] = MetricsWidget::class;
283 283
             }
284 284
         );
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
         Event::on(
287 287
             UserPermissions::class,
288 288
             UserPermissions::EVENT_REGISTER_PERMISSIONS,
289
-            function (RegisterUserPermissionsEvent $event) {
289
+            function(RegisterUserPermissionsEvent $event) {
290 290
                 Craft::debug(
291 291
                     'UserPermissions::EVENT_REGISTER_PERMISSIONS',
292 292
                     __METHOD__
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
             Event::on(
312 312
                 View::class,
313 313
                 View::EVENT_END_PAGE,
314
-                function () {
314
+                function() {
315 315
                     Craft::debug(
316 316
                         'View::EVENT_END_PAGE',
317 317
                         __METHOD__
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
             Event::on(
342 342
                 View::class,
343 343
                 View::EVENT_END_BODY,
344
-                function () {
344
+                function() {
345 345
                     Craft::debug(
346 346
                         'View::EVENT_END_BODY',
347 347
                         __METHOD__
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
             Event::on(
365 365
                 Craft::$app,
366 366
                 Craft::$app::EVENT_AFTER_REQUEST,
367
-                function () {
367
+                function() {
368 368
                     Craft::debug(
369 369
                         'Craft::$app::EVENT_AFTER_REQUEST',
370 370
                         __METHOD__
Please login to merge, or discard this patch.