diff --git a/src/Routing.php b/src/Routing.php index 98ce4c2..c359c40 100644 --- a/src/Routing.php +++ b/src/Routing.php @@ -27,21 +27,13 @@ class Routing { ) { } public function registerRoute(ContainerInterface $container, string $urlBase) { - #$this->registeredRoutes ??= []; - $this->router->group(rtrim($urlBase, "/"), function (RouteGroup $route) use ($container) { foreach($this->fetchRoutesAttributes() as $attribute) { $this->eventManager->execute(Event\RoutingCompileRoutes::class, $this, $attribute); # Mapping every URLs from attributes in searched folders (Api, Controller, etc...) foreach((array) $attribute->method as $method) { - #if (! empty($this->registeredRoutes[$attribute->getRoute().$method])) { - # continue; - #} - - #$this->registeredRoutes[$attribute->getRoute().$method] = true; - - $route->map(strtoupper($method), $attribute->getRoute(), function (ServerRequestInterface $request, array $arguments) use ( + $route->map(strtoupper($method), $attribute->getRegistrableRoute(), function (ServerRequestInterface $request, array $arguments) use ( $container, $route, $attribute ) : ResponseInterface { $class = $attribute->class;