$params * @return list */ public function fetch(string $requestUrl, CrawlSource $source, array $params): array { return $this->adapter($source->adapter_code)->fetch($requestUrl, $source, $params); } protected function adapter(string $code): CrawlerAdapterInterface { return match ($code) { 'arxiv_api' => $this->arxiv, 'pedaily_html' => $this->pedaily, 'generic_news_html' => $this->genericNews, 'generic_paper_html' => $this->genericPaper, 'faculty_list_html' => $this->facultyList, default => throw new \InvalidArgumentException("未支持的适配器:{$code}"), }; } }