@@ -58,7 +58,7 @@ discard block |
||
| 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 |
||
| 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__ |
@@ -98,11 +98,11 @@ discard block |
||
| 98 | 98 | Event::on( |
| 99 | 99 | ClearCaches::class, |
| 100 | 100 | ClearCaches::EVENT_REGISTER_CACHE_OPTIONS, |
| 101 | - function (RegisterCacheOptionsEvent $event) { |
|
| 101 | + function(RegisterCacheOptionsEvent $event) { |
|
| 102 | 102 | $event->options[] = [ |
| 103 | 103 | 'key' => 'route-map', |
| 104 | 104 | 'label' => Craft::t('route-map', 'Route Map Cache'), |
| 105 | - 'action' => function () { |
|
| 105 | + 'action' => function() { |
|
| 106 | 106 | RouteMap::$plugin->routes->invalidateCache(); |
| 107 | 107 | }, |
| 108 | 108 | ]; |
@@ -163,9 +163,9 @@ discard block |
||
| 163 | 163 | ]); |
| 164 | 164 | |
| 165 | 165 | // Just return the data if it's already cached |
| 166 | - $routes = $cache->getOrSet($cacheKey, function () use ($section, $format, $siteId) { |
|
| 166 | + $routes = $cache->getOrSet($cacheKey, function() use ($section, $format, $siteId) { |
|
| 167 | 167 | Craft::info( |
| 168 | - 'Route Map cache miss: '.$section, |
|
| 168 | + 'Route Map cache miss: ' . $section, |
|
| 169 | 169 | __METHOD__ |
| 170 | 170 | ); |
| 171 | 171 | $resultingRoutes = []; |
@@ -276,9 +276,9 @@ discard block |
||
| 276 | 276 | ], |
| 277 | 277 | ]); |
| 278 | 278 | // Just return the data if it's already cached |
| 279 | - $routes = $cache->getOrSet($cacheKey, function () use ($category, $handle, $format, $siteId) { |
|
| 279 | + $routes = $cache->getOrSet($cacheKey, function() use ($category, $handle, $format, $siteId) { |
|
| 280 | 280 | Craft::info( |
| 281 | - 'Route Map cache miss: '.$category, |
|
| 281 | + 'Route Map cache miss: ' . $category, |
|
| 282 | 282 | __METHOD__ |
| 283 | 283 | ); |
| 284 | 284 | $resultingRoutes = []; |
@@ -340,9 +340,9 @@ discard block |
||
| 340 | 340 | ]); |
| 341 | 341 | |
| 342 | 342 | // Just return the data if it's already cached |
| 343 | - $assetUrls = $cache->getOrSet($cacheKey, function () use ($uri, $assetTypes, $siteId) { |
|
| 343 | + $assetUrls = $cache->getOrSet($cacheKey, function() use ($uri, $assetTypes, $siteId) { |
|
| 344 | 344 | Craft::info( |
| 345 | - 'Route Map cache miss: '.$uri, |
|
| 345 | + 'Route Map cache miss: ' . $uri, |
|
| 346 | 346 | __METHOD__ |
| 347 | 347 | ); |
| 348 | 348 | $resultingAssetUrls = []; |
@@ -422,9 +422,9 @@ discard block |
||
| 422 | 422 | ]); |
| 423 | 423 | |
| 424 | 424 | // Just return the data if it's already cached |
| 425 | - $urls = $cache->getOrSet($cacheKey, function () use ($elementClass, $criteria) { |
|
| 425 | + $urls = $cache->getOrSet($cacheKey, function() use ($elementClass, $criteria) { |
|
| 426 | 426 | Craft::info( |
| 427 | - 'Route Map cache miss: '.$elementClass, |
|
| 427 | + 'Route Map cache miss: ' . $elementClass, |
|
| 428 | 428 | __METHOD__ |
| 429 | 429 | ); |
| 430 | 430 | $resultingUrls = []; |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | ->orderBy(['sortOrder' => SORT_ASC]) |
| 513 | 513 | ->all(); |
| 514 | 514 | |
| 515 | - return ArrayHelper::map($results, 'uriPattern', function ($results) { |
|
| 515 | + return ArrayHelper::map($results, 'uriPattern', function($results) { |
|
| 516 | 516 | return ['template' => $results['template']]; |
| 517 | 517 | }); |
| 518 | 518 | } |
@@ -538,7 +538,7 @@ discard block |
||
| 538 | 538 | $replaceRegEx = ':$1'; |
| 539 | 539 | $route['url'] = preg_replace($matchRegEx, $replaceRegEx, $route['url']); |
| 540 | 540 | // Add a leading / |
| 541 | - $route['url'] = '/'.ltrim($route['url'], '/'); |
|
| 541 | + $route['url'] = '/' . ltrim($route['url'], '/'); |
|
| 542 | 542 | break; |
| 543 | 543 | |
| 544 | 544 | // Craft-style URLs don't need to be changed |
@@ -595,7 +595,7 @@ discard block |
||
| 595 | 595 | $flattenedArgs = md5($flattenedArgs); |
| 596 | 596 | } |
| 597 | 597 | |
| 598 | - return $cacheKey.$flattenedArgs; |
|
| 598 | + return $cacheKey . $flattenedArgs; |
|
| 599 | 599 | } |
| 600 | 600 | |
| 601 | 601 | /** |