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