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