protected function matchDynamicRoute(string $path, string $method): array
    {
        $first = \strstr(\ltrim($path, '/'), '/', true);
        $fKey  = $first ? $method . ' ' . $first : '';

        // It is a regular dynamic route(the first node is 1th level index key).
        if ($fKey && isset($this->regularRoutes[$fKey])) {
            /** @var Route $route */
            foreach ($this->regularRoutes[$fKey] as $route) {
                // Check path start string
                $pathStart = $route->getPathStart();
                if (\strpos($path, $pathStart) !== 0) {
                    continue;
                }

                $result = $route->matchRegex($path);
                if ($result[0]) {
                    return [self::FOUND, $path, $route->copyWithParams($result[1])];
                }
            }
        }

        // It is a irregular dynamic route
        // if ($routeList = $this->vagueRoutes[$method] ?? false) {
        if (isset($this->vagueRoutes[$method])) {
            foreach ($this->vagueRoutes[$method] as $route) {
                $result = $route->matchRegex($path);
                if ($result[0]) {
                    return [self::FOUND, $path, $route->copyWithParams($result[1])];
                }
            }
        }

        return [self::NOT_FOUND, $path, null];
    }