getAttributeMapper(); $this->dispatcher ->pushMapper($attributeMapper) ->pushMapper($simpleMapper); $this->dispatcher ->addMatchType('locale', '[a-z]{2}-[A-Z]{2}'); $this->app ->set(AttributeMapper::class, $attributeMapper) ->set(SimpleMapper::class, $simpleMapper); } private function getAttributeMapper(): AttributeMapper { $mapper = new AttributeMapper($this->cache); $mapper->addPath($this->routeDir); $this->enableCaching && !$this->enableDebugging ? $mapper->enableCaching() : $mapper->disableCaching(); return $mapper; } }