diff --git a/src/Router/HandlerMapping.php b/src/Router/HandlerMapping.php index 3adbe5f..c0c466c 100644 --- a/src/Router/HandlerMapping.php +++ b/src/Router/HandlerMapping.php @@ -164,7 +164,7 @@ protected function prepareForMap(string $route, $handler, array $opts): array protected function collectParamRoute(string $route, array $methods, array $conf) { $conf['original'] = $route; - $params = $this->getAvailableParams($opts['params'] ?? []); + $params = $this->getAvailableParams($conf['option']['params'] ?? []); list($first, $conf) = $this->parseParamRoute($route, $params, $conf); // route string have regular @@ -366,7 +366,10 @@ protected function findInRegularRoutes(array $routesData, string $path, string $ } } - return [self::NOT_FOUND, \explode(',', \trim($allowedMethods, ','))]; + return [ + self::NOT_FOUND, + $allowedMethods ? \explode(',', \rtrim($allowedMethods, ',')) : [] + ]; } /**