diff --git a/src/Routing/Middleware/RoutingMiddleware.php b/src/Routing/Middleware/RoutingMiddleware.php index c4d1db88b58..3149a906995 100644 --- a/src/Routing/Middleware/RoutingMiddleware.php +++ b/src/Routing/Middleware/RoutingMiddleware.php @@ -89,9 +89,9 @@ protected function buildRouteCollection() { $isRouterCacheEnabled = Configure::read('Router.cache'); if (Cache::enabled() && $isRouterCacheEnabled) { - $routesCacheConfig = Configure::read('Router.cacheConfig', self::DEFAULT_ROUTER_CACHE_CONFIG); + $routesCacheConfig = Configure::read('Router.cacheConfig', static::DEFAULT_ROUTER_CACHE_CONFIG); - return Cache::remember(self::ROUTE_COLLECTION_CACHE_KEY, function () { + return Cache::remember(static::ROUTE_COLLECTION_CACHE_KEY, function () { return $this->prepareRouteCollection(); }, $routesCacheConfig);