diff --git a/HttpServer/Route/Node.php b/HttpServer/Route/Node.php index cb87f55f..58293d06 100644 --- a/HttpServer/Route/Node.php +++ b/HttpServer/Route/Node.php @@ -256,18 +256,12 @@ class Node extends HttpService /** * @param Node $node - * @param string $field * @return Node */ - public function addChild(Node $node, string $field): Node + public function addChild(Node $node): Node { - /** @var Node $oLod */ - $oLod = $this->childes[$field] ?? null; - if (!empty($oLod)) { - $node = $oLod; - } - $this->childes[$field] = $node; - return $this->childes[$field]; + $this->childes[] = $node; + return $node; } diff --git a/HttpServer/Route/Router.php b/HttpServer/Route/Router.php index f5ac6f87..2784f49b 100644 --- a/HttpServer/Route/Router.php +++ b/HttpServer/Route/Router.php @@ -166,7 +166,7 @@ class Router extends HttpService implements RouterInterface ++$a; $search = $parent->findNode($value); if ($search === null) { - $parent = $parent->addChild($this->NodeInstance($value, $a, $method), $value); + $parent = $parent->addChild($this->NodeInstance($value, $a, $method)); } else { $parent = $search; }