src/Leevel/Router/Match/Annotation.php
protected function matcheSuccessed(array $routers, array $matcheVars = []): array
    {
        // 协议匹配
        if (!empty($routers['scheme']) &&
            false === $this->matcheScheme($routers['scheme'])) {
            return [];
        }

        // 域名匹配
        if (false === ($domainVars = $this->matcheDomain($routers))) {
            return [];
        }

        // 未绑定
        if (!$routers['bind']) {
            return [];
        }

        $result = [];

        $result[IRouter::BIND] = $routers['bind'];
        $result[IRouter::APP] = $this->findApp($routers['bind']);

        $result['params'] = [];

        // 域名匹配参数 {subdomain}.{domain}
        if ($domainVars) {
            $result['params'] = $domainVars;
        }

        // 路由匹配参数 /v1/pet/{id}
        if ($matcheVars) {
            $result['params'] = array_merge($result['params'], $matcheVars);
        }

        // 额外参数 ['extend1' => 'foo']
        if (isset($routers['params']) && is_array($routers['params'])) {
            $result['params'] = array_merge($result['params'], $routers['params']);
        }

        $result[IRouter::PARAMS] = $result['params'];
        unset($result['params']);

        // 中间件
        if (isset($routers['middlewares'])) {
            $this->middlewares = $this->mergeMiddlewares($this->middlewares, $routers['middlewares']);
        }

        $result[IRouter::MIDDLEWARES] = $this->middlewares;

        // 匹配的变量
        $result[IRouter::VARS] = $this->matchedVars;

        return $result;
    }
protected function matcheSuccessed(array $routers, array $matcheVars = []): array
    {
        // 协议匹配
        if (!empty($routers['scheme']) &&
            false === $this->matcheScheme($routers['scheme'])) {
            return [];
        }

        // 域名匹配
        if (false === ($domainVars = $this->matcheDomain($routers))) {
            return [];
        }

        // 未绑定
        if (!$routers['bind']) {
            return [];
        }

        $result = [];

        $result[IRouter::BIND] = $routers['bind'];
        $result[IRouter::APP] = $this->findApp($routers['bind']);

        $result['params'] = [];

        // 域名匹配参数 {subdomain}.{domain}
        if ($domainVars) {
            $result['params'] = $domainVars;
        }

        // 路由匹配参数 /v1/pet/{id}
        if ($matcheVars) {
            $result['params'] = array_merge($result['params'], $matcheVars);
        }

        // 额外参数 ['extend1' => 'foo']
        if (isset($routers['params']) && is_array($routers['params'])) {
            $result['params'] = array_merge($result['params'], $routers['params']);
        }

        $result[IRouter::PARAMS] = $result['params'];
        unset($result['params']);

        // 中间件
        if (isset($routers['middlewares'])) {
            $this->middlewares = $this->mergeMiddlewares($this->middlewares, $routers['middlewares']);
        }

        $result[IRouter::MIDDLEWARES] = $this->middlewares;

        // 匹配的变量
        $result[IRouter::VARS] = $this->matchedVars;

        return $result;
    }
注解路由匹配成功处理.

@param array $routers
@param array $matcheVars

@return array