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