改名
This commit is contained in:
@@ -256,18 +256,12 @@ class Node extends HttpService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Node $node
|
* @param Node $node
|
||||||
* @param string $field
|
|
||||||
* @return Node
|
* @return Node
|
||||||
*/
|
*/
|
||||||
public function addChild(Node $node, string $field): Node
|
public function addChild(Node $node): Node
|
||||||
{
|
{
|
||||||
/** @var Node $oLod */
|
$this->childes[] = $node;
|
||||||
$oLod = $this->childes[$field] ?? null;
|
return $node;
|
||||||
if (!empty($oLod)) {
|
|
||||||
$node = $oLod;
|
|
||||||
}
|
|
||||||
$this->childes[$field] = $node;
|
|
||||||
return $this->childes[$field];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ class Router extends HttpService implements RouterInterface
|
|||||||
++$a;
|
++$a;
|
||||||
$search = $parent->findNode($value);
|
$search = $parent->findNode($value);
|
||||||
if ($search === null) {
|
if ($search === null) {
|
||||||
$parent = $parent->addChild($this->NodeInstance($value, $a, $method), $value);
|
$parent = $parent->addChild($this->NodeInstance($value, $a, $method));
|
||||||
} else {
|
} else {
|
||||||
$parent = $search;
|
$parent = $search;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user