Passed
Push — develop ( dcb813...831756 )
by Andrew
08:50 queued 04:09
created
src/RouteMap.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         Event::on(
59 59
             CraftVariable::class,
60 60
             CraftVariable::EVENT_INIT,
61
-            function (Event $event) {
61
+            function(Event $event) {
62 62
                 /** @var CraftVariable $variable */
63 63
                 $variable = $event->sender;
64 64
                 $variable->set('routeMap', RouteMapVariable::class);
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         Event::on(
70 70
             Elements::class,
71 71
             Elements::EVENT_AFTER_SAVE_ELEMENT,
72
-            function (ElementEvent $event) {
72
+            function(ElementEvent $event) {
73 73
                 Craft::debug(
74 74
                     'Elements::EVENT_AFTER_SAVE_ELEMENT',
75 75
                     __METHOD__
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
                 }
86 86
                 if ($bustCache) {
87 87
                     Craft::debug(
88
-                        'Cache busted due to saving: ' . \get_class($element) . ' - ' . $element->title,
88
+                        'Cache busted due to saving: '.\get_class($element).' - '.$element->title,
89 89
                         __METHOD__
90 90
                     );
91 91
                     RouteMap::$plugin->routes->invalidateCache();
@@ -97,11 +97,11 @@  discard block
 block discarded – undo
97 97
         Event::on(
98 98
             ClearCaches::class,
99 99
             ClearCaches::EVENT_REGISTER_CACHE_OPTIONS,
100
-            function (RegisterCacheOptionsEvent $event) {
100
+            function(RegisterCacheOptionsEvent $event) {
101 101
                 $event->options[] = [
102 102
                     'key' => 'route-map',
103 103
                     'label' => Craft::t('route-map', 'Route Map Cache'),
104
-                    'action' => function () {
104
+                    'action' => function() {
105 105
                         RouteMap::$plugin->routes->invalidateCache();
106 106
                     },
107 107
                 ];
Please login to merge, or discard this patch.
src/services/Routes.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
         ]);
166 166
 
167 167
         // Just return the data if it's already cached
168
-        $routes = $cache->getOrSet($cacheKey, function () use ($section, $format, $siteId) {
168
+        $routes = $cache->getOrSet($cacheKey, function() use ($section, $format, $siteId) {
169 169
             Craft::info(
170 170
                 'Route Map cache miss: '.$section,
171 171
                 __METHOD__
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
                 $sites = $section->getSiteSettings();
178 178
 
179 179
                 foreach ($sites as $site) {
180
-                    if ($site->hasUrls && ($siteId === null || (int)$site->siteId === $siteId)) {
180
+                    if ($site->hasUrls && ($siteId === null || (int) $site->siteId === $siteId)) {
181 181
                         // Get section data to return
182 182
                         $route = [
183 183
                             'handle'   => $section->handle,
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
             ],
281 281
         ]);
282 282
         // Just return the data if it's already cached
283
-        $routes = $cache->getOrSet($cacheKey, function () use ($category, $handle, $format, $siteId) {
283
+        $routes = $cache->getOrSet($cacheKey, function() use ($category, $handle, $format, $siteId) {
284 284
             Craft::info(
285 285
                 'Route Map cache miss: '.$category,
286 286
                 __METHOD__
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
                 $sites = $category->getSiteSettings();
292 292
 
293 293
                 foreach ($sites as $site) {
294
-                    if ($site->hasUrls && ($siteId === null || (int)$site->siteId === $siteId)) {
294
+                    if ($site->hasUrls && ($siteId === null || (int) $site->siteId === $siteId)) {
295 295
                         // Get section data to return
296 296
                         $route = [
297 297
                             'handle'   => $category->handle,
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
         ]);
345 345
 
346 346
         // Just return the data if it's already cached
347
-        $assetUrls = $cache->getOrSet($cacheKey, function () use ($uri, $assetTypes, $siteId) {
347
+        $assetUrls = $cache->getOrSet($cacheKey, function() use ($uri, $assetTypes, $siteId) {
348 348
             Craft::info(
349 349
                 'Route Map cache miss: '.$uri,
350 350
                 __METHOD__
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
         ]);
427 427
 
428 428
         // Just return the data if it's already cached
429
-        $urls = $cache->getOrSet($cacheKey, function () use ($elementClass, $criteria) {
429
+        $urls = $cache->getOrSet($cacheKey, function() use ($elementClass, $criteria) {
430 430
             Craft::info(
431 431
                 'Route Map cache miss: '.$elementClass,
432 432
                 __METHOD__
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
             ->orderBy(['sortOrder' => SORT_ASC])
525 525
             ->all();
526 526
 
527
-        return ArrayHelper::map($results, 'uriPattern', function ($results) {
527
+        return ArrayHelper::map($results, 'uriPattern', function($results) {
528 528
             return ['template' => $results['template']];
529 529
         });
530 530
     }
Please login to merge, or discard this patch.