| Conditions | 1 |
| Paths | 1 |
| Total Lines | 18 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 50 | 3 | protected function items($link) |
|
| 51 | { |
||
| 52 | 3 | $crawler = new DomCrawler(Client::request($link)); |
|
| 53 | |||
| 54 | 3 | $pattern = '.search-inner > .outer-content'; |
|
| 55 | |||
| 56 | 3 | $news = $crawler->filter((string) $pattern); |
|
| 57 | |||
| 58 | 3 | $items = $news->each(function (DomCrawler $node) |
|
| 59 | { |
||
| 60 | 3 | $pattern = '.inner-content > .title > a'; |
|
| 61 | |||
| 62 | 3 | $result = $node->filter((string) $pattern); |
|
| 63 | |||
| 64 | 3 | return $result->first()->attr('href'); |
|
| 65 | 3 | }); |
|
| 66 | |||
| 67 | 1 | return array_reverse($items); |
|
| 68 | } |
||
| 70 |