@@ -5,7 +5,7 @@ |
||
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(); |
@@ -94,7 +94,7 @@ |
||
94 | 94 | } |
95 | 95 | if ($bustCache) { |
96 | 96 | Craft::debug( |
97 | - 'Cache busted due to saving: ' . get_class($element) . ' - ' . $element->title, |
|
97 | + 'Cache busted due to saving: '.get_class($element).' - '.$element->title, |
|
98 | 98 | __METHOD__ |
99 | 99 | ); |
100 | 100 | RouteMap::$plugin->routes->invalidateCache(); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | { |
75 | 75 | // Cast explicitly |
76 | 76 | if ($siteId) { |
77 | - $siteId = (int)$siteId; |
|
77 | + $siteId = (int) $siteId; |
|
78 | 78 | } |
79 | 79 | $urls = []; |
80 | 80 | $elements = Craft::$app->getElements(); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | { |
99 | 99 | // Cast explicitly |
100 | 100 | if ($siteId) { |
101 | - $siteId = (int)$siteId; |
|
101 | + $siteId = (int) $siteId; |
|
102 | 102 | } |
103 | 103 | // Get all of the sections |
104 | 104 | $sections = $this->getAllSectionRouteRules($format, $siteId); |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | { |
126 | 126 | // Cast explicitly |
127 | 127 | if ($siteId) { |
128 | - $siteId = (int)$siteId; |
|
128 | + $siteId = (int) $siteId; |
|
129 | 129 | } |
130 | 130 | $criteria = array_merge([ |
131 | 131 | 'section' => $section, |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | { |
148 | 148 | // Cast explicitly |
149 | 149 | if ($siteId) { |
150 | - $siteId = (int)$siteId; |
|
150 | + $siteId = (int) $siteId; |
|
151 | 151 | } |
152 | 152 | $routeRules = []; |
153 | 153 | // Get all of the sections |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | { |
176 | 176 | // Cast explicitly |
177 | 177 | if ($siteId) { |
178 | - $siteId = (int)$siteId; |
|
178 | + $siteId = (int) $siteId; |
|
179 | 179 | } |
180 | 180 | $devMode = Craft::$app->getConfig()->getGeneral()->devMode; |
181 | 181 | $cache = Craft::$app->getCache(); |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | // Just return the data if it's already cached |
193 | 193 | $routes = $cache->getOrSet($cacheKey, function() use ($section, $format, $siteId) { |
194 | 194 | Craft::info( |
195 | - 'Route Map cache miss: ' . $section, |
|
195 | + 'Route Map cache miss: '.$section, |
|
196 | 196 | __METHOD__ |
197 | 197 | ); |
198 | 198 | $resultingRoutes = []; |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | $sites = $section->getSiteSettings(); |
203 | 203 | |
204 | 204 | foreach ($sites as $site) { |
205 | - if ($site->hasUrls && ($siteId === null || (int)$site->siteId === $siteId)) { |
|
205 | + if ($site->hasUrls && ($siteId === null || (int) $site->siteId === $siteId)) { |
|
206 | 206 | // Get section data to return |
207 | 207 | $route = [ |
208 | 208 | 'handle' => $section->handle, |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | { |
242 | 242 | // Cast explicitly |
243 | 243 | if ($siteId) { |
244 | - $siteId = (int)$siteId; |
|
244 | + $siteId = (int) $siteId; |
|
245 | 245 | } |
246 | 246 | $criteria = array_merge([ |
247 | 247 | 'group' => $category, |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | { |
263 | 263 | // Cast explicitly |
264 | 264 | if ($siteId) { |
265 | - $siteId = (int)$siteId; |
|
265 | + $siteId = (int) $siteId; |
|
266 | 266 | } |
267 | 267 | $routeRules = []; |
268 | 268 | // Get all of the sections |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | { |
291 | 291 | // Cast explicitly |
292 | 292 | if ($siteId) { |
293 | - $siteId = (int)$siteId; |
|
293 | + $siteId = (int) $siteId; |
|
294 | 294 | } |
295 | 295 | $devMode = Craft::$app->getConfig()->getGeneral()->devMode; |
296 | 296 | $cache = Craft::$app->getCache(); |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | // Just return the data if it's already cached |
319 | 319 | $routes = $cache->getOrSet($cacheKey, function() use ($category, $handle, $format, $siteId) { |
320 | 320 | Craft::info( |
321 | - 'Route Map cache miss: ' . $category, |
|
321 | + 'Route Map cache miss: '.$category, |
|
322 | 322 | __METHOD__ |
323 | 323 | ); |
324 | 324 | $resultingRoutes = []; |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | $sites = $category->getSiteSettings(); |
328 | 328 | |
329 | 329 | foreach ($sites as $site) { |
330 | - if ($site->hasUrls && ($siteId === null || (int)$site->siteId === $siteId)) { |
|
330 | + if ($site->hasUrls && ($siteId === null || (int) $site->siteId === $siteId)) { |
|
331 | 331 | // Get section data to return |
332 | 332 | $route = [ |
333 | 333 | 'handle' => $category->handle, |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | { |
367 | 367 | // Cast explicitly |
368 | 368 | if ($siteId) { |
369 | - $siteId = (int)$siteId; |
|
369 | + $siteId = (int) $siteId; |
|
370 | 370 | } |
371 | 371 | $devMode = Craft::$app->getConfig()->getGeneral()->devMode; |
372 | 372 | $cache = Craft::$app->getCache(); |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | // Just return the data if it's already cached |
387 | 387 | $assetUrls = $cache->getOrSet($cacheKey, function() use ($uri, $assetTypes, $siteId) { |
388 | 388 | Craft::info( |
389 | - 'Route Map cache miss: ' . $uri, |
|
389 | + 'Route Map cache miss: '.$uri, |
|
390 | 390 | __METHOD__ |
391 | 391 | ); |
392 | 392 | $resultingAssetUrls = []; |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | { |
450 | 450 | // Cast explicitly |
451 | 451 | if ($siteId) { |
452 | - $siteId = (int)$siteId; |
|
452 | + $siteId = (int) $siteId; |
|
453 | 453 | } |
454 | 454 | $devMode = Craft::$app->getConfig()->getGeneral()->devMode; |
455 | 455 | $cache = Craft::$app->getCache(); |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | // Just return the data if it's already cached |
473 | 473 | $urls = $cache->getOrSet($cacheKey, function() use ($elementClass, $criteria) { |
474 | 474 | Craft::info( |
475 | - 'Route Map cache miss: ' . $elementClass, |
|
475 | + 'Route Map cache miss: '.$elementClass, |
|
476 | 476 | __METHOD__ |
477 | 477 | ); |
478 | 478 | $resultingUrls = []; |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | { |
524 | 524 | // Cast explicitly |
525 | 525 | if ($siteId) { |
526 | - $siteId = (int)$siteId; |
|
526 | + $siteId = (int) $siteId; |
|
527 | 527 | } |
528 | 528 | $globalRules = $includeGlobal === true ? $this->getDbRoutes('global') : []; |
529 | 529 | |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | $siteId = null; |
559 | 559 | } |
560 | 560 | if ($siteId) { |
561 | - $siteId = (int)$siteId; |
|
561 | + $siteId = (int) $siteId; |
|
562 | 562 | } |
563 | 563 | |
564 | 564 | // If we're on Craft 3.1 or later, just return the array from getProjectConfigRoutes(); |
@@ -603,7 +603,7 @@ discard block |
||
603 | 603 | $replaceRegEx = ':$1'; |
604 | 604 | $route['url'] = preg_replace($matchRegEx, $replaceRegEx, $route['url']); |
605 | 605 | // Add a leading / |
606 | - $route['url'] = '/' . ltrim($route['url'], '/'); |
|
606 | + $route['url'] = '/'.ltrim($route['url'], '/'); |
|
607 | 607 | break; |
608 | 608 | |
609 | 609 | // Craft-style URLs don't need to be changed |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | $flattenedArgs = md5($flattenedArgs); |
661 | 661 | } |
662 | 662 | |
663 | - return $cacheKey . $flattenedArgs; |
|
663 | + return $cacheKey.$flattenedArgs; |
|
664 | 664 | } |
665 | 665 | |
666 | 666 | /** |