Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | public function crawl(HttpClientInterface $httpClient, Symbol $symbol): Site |
||
27 | { |
||
28 | $symbol = mb_strtolower($symbol->toString()); |
||
29 | $url = sprintf(self::REQUEST_URL, $symbol); |
||
30 | |||
31 | $html = $httpClient |
||
32 | ->request(self::REQUEST_METHOD, $url) |
||
33 | ->getContent($throw = false); |
||
34 | |||
35 | $crawled = []; |
||
36 | |||
37 | foreach ($this->crawlers as $name => $crawler) { |
||
38 | $crawled[$name] = $crawler->crawlHtml($html); |
||
39 | } |
||
40 | |||
41 | return new Site($crawled); |
||
42 | } |
||
44 |