Passed
Push — v5 ( fce18f...5703ce )
by Andrew
18:03 queued 12:51
created
ecs.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 
6 6
 return static function(ECSConfig $ecsConfig): void {
7 7
     $ecsConfig->paths([
8
-        __DIR__ . '/src',
8
+        __DIR__.'/src',
9 9
         __FILE__,
10 10
     ]);
11 11
     $ecsConfig->parallel();
Please login to merge, or discard this patch.
src/RouteMap.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@
 block discarded – undo
105 105
 
106 106
                 if ($bustCache) {
107 107
                     Craft::debug(
108
-                        'Cache busted due to saving: ' . $element::class . ' - ' . $element->title,
108
+                        'Cache busted due to saving: '.$element::class.' - '.$element->title,
109 109
                         __METHOD__
110 110
                     );
111 111
                     RouteMap::$plugin->routes->invalidateCache();
Please login to merge, or discard this patch.
src/controllers/RoutesController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     // Protected Properties
26 26
     // =========================================================================
27 27
 
28
-    protected array|bool|int $allowAnonymous = [
28
+    protected array | bool | int $allowAnonymous = [
29 29
         'get-all-urls',
30 30
         'get-section-urls',
31 31
         'get-all-route-rules',
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
      * @param ?int $siteId
134 134
      * @return Response
135 135
      */
136
-    public function actionGetElementUrls(string|ElementInterface $elementType, array $criteria = [], ?int $siteId = null): Response
136
+    public function actionGetElementUrls(string | ElementInterface $elementType, array $criteria = [], ?int $siteId = null): Response
137 137
     {
138 138
         return $this->asJson(RouteMap::$plugin->routes->getElementUrls($elementType, $criteria, $siteId));
139 139
     }
Please login to merge, or discard this patch.
src/variables/RouteMapVariable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -148,7 +148,7 @@
 block discarded – undo
148 148
      * @param ?int $siteId
149 149
      * @return array
150 150
      */
151
-    public function getElementUrls(string|ElementInterface $elementType, array $criteria = [], ?int $siteId = null): array
151
+    public function getElementUrls(string | ElementInterface $elementType, array $criteria = [], ?int $siteId = null): array
152 152
     {
153 153
         return RouteMap::$plugin->routes->getElementUrls($elementType, $criteria, $siteId);
154 154
     }
Please login to merge, or discard this patch.
src/services/Routes.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
         // Just return the data if it's already cached
202 202
         return $cache->getOrSet($cacheKey, function() use ($section, $format, $siteId): array {
203 203
             Craft::info(
204
-                'Route Map cache miss: ' . $section,
204
+                'Route Map cache miss: '.$section,
205 205
                 __METHOD__
206 206
             );
207 207
             $resultingRoutes = [];
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
                 $sites = $section->getSiteSettings();
212 212
 
213 213
                 foreach ($sites as $site) {
214
-                    if ($site->hasUrls && ($siteId === null || (int)$site->siteId === $siteId)) {
214
+                    if ($site->hasUrls && ($siteId === null || (int) $site->siteId === $siteId)) {
215 215
                         // Get section data to return
216 216
                         $route = [
217 217
                             'handle' => $section->handle,
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
      * @param ?int $siteId
285 285
      * @return array
286 286
      */
287
-    public function getCategoryRouteRules(int|string $category, string $format = 'Craft', ?int $siteId = null): array
287
+    public function getCategoryRouteRules(int | string $category, string $format = 'Craft', ?int $siteId = null): array
288 288
     {
289 289
         $devMode = Craft::$app->getConfig()->getGeneral()->devMode;
290 290
         $cache = Craft::$app->getCache();
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
         // Just return the data if it's already cached
316 316
         return $cache->getOrSet($cacheKey, function() use ($category, $handle, $format, $siteId): array {
317 317
             Craft::info(
318
-                'Route Map cache miss: ' . $category,
318
+                'Route Map cache miss: '.$category,
319 319
                 __METHOD__
320 320
             );
321 321
             $resultingRoutes = [];
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
                 $sites = $category->getSiteSettings();
325 325
 
326 326
                 foreach ($sites as $site) {
327
-                    if ($site->hasUrls && ($siteId === null || (int)$site->siteId === $siteId)) {
327
+                    if ($site->hasUrls && ($siteId === null || (int) $site->siteId === $siteId)) {
328 328
                         // Get section data to return
329 329
                         $route = [
330 330
                             'handle' => $category->handle,
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
         // Just return the data if it's already cached
378 378
         return $cache->getOrSet($cacheKey, function() use ($uri, $assetTypes, $siteId): array {
379 379
             Craft::info(
380
-                'Route Map cache miss: ' . $uri,
380
+                'Route Map cache miss: '.$uri,
381 381
                 __METHOD__
382 382
             );
383 383
             $resultingAssetUrls = [];
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
      * @param ?int $siteId
434 434
      * @return array
435 435
      */
436
-    public function getElementUrls(string|ElementInterface $elementType, array $criteria = [], ?int $siteId = null): array
436
+    public function getElementUrls(string | ElementInterface $elementType, array $criteria = [], ?int $siteId = null): array
437 437
     {
438 438
         $devMode = Craft::$app->getConfig()->getGeneral()->devMode;
439 439
         $cache = Craft::$app->getCache();
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
         // Just return the data if it's already cached
458 458
         return $cache->getOrSet($cacheKey, function() use ($elementInterface, $criteria): array {
459 459
             Craft::info(
460
-                'Route Map cache miss: ' . $elementInterface::class,
460
+                'Route Map cache miss: '.$elementInterface::class,
461 461
                 __METHOD__
462 462
             );
463 463
             $resultingUrls = [];
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
                 $replaceRegEx = ':$1';
549 549
                 $route['url'] = preg_replace($matchRegEx, $replaceRegEx, $route['url']);
550 550
                 // Add a leading /
551
-                $route['url'] = '/' . ltrim($route['url'], '/');
551
+                $route['url'] = '/'.ltrim($route['url'], '/');
552 552
                 break;
553 553
 
554 554
             // Craft-style URLs don't need to be changed
@@ -601,7 +601,7 @@  discard block
 block discarded – undo
601 601
             $flattenedArgs = md5($flattenedArgs);
602 602
         }
603 603
 
604
-        return $cacheKey . $flattenedArgs;
604
+        return $cacheKey.$flattenedArgs;
605 605
     }
606 606
 
607 607
     /**
Please login to merge, or discard this patch.