This commit is contained in:
2021-09-08 15:31:24 +08:00
parent 3499d65104
commit 6836a8672e
+2 -5
View File
@@ -401,11 +401,8 @@ class Router extends HttpService implements RouterInterface
*/
public function tree_search(?array $explode): ?Node
{
if (empty($this->nodes)) {
return null;
}
$parent = $this->nodes[$explode] ?? null;
if (!($parent instanceof Node)) {
$parent = $this->nodes[array_shift($explode)] ?? null;
if (is_null($parent)) {
return null;
}
while ($value = array_shift($explode)) {