改名
This commit is contained in:
@@ -419,16 +419,10 @@ class Router extends HttpService implements RouterInterface
|
|||||||
*/
|
*/
|
||||||
public function tree_search(?array $explode, $method): ?Node
|
public function tree_search(?array $explode, $method): ?Node
|
||||||
{
|
{
|
||||||
if (empty($explode)) {
|
if (!isset(static::$nodes[$method])) {
|
||||||
return static::$nodes[$method]['/'] ?? null;
|
|
||||||
}
|
|
||||||
$first = array_shift($explode);
|
|
||||||
if (!($parent = static::$nodes[$method][$first] ?? null)) {
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (empty($explode)) {
|
$parent = static::$nodes[$method]['/'];
|
||||||
return $parent->findNode('/');
|
|
||||||
}
|
|
||||||
while ($value = array_shift($explode)) {
|
while ($value = array_shift($explode)) {
|
||||||
$node = $parent->findNode($value);
|
$node = $parent->findNode($value);
|
||||||
if (!$node) {
|
if (!$node) {
|
||||||
|
|||||||
Reference in New Issue
Block a user