Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
25 | public function filterNodes(Crawler $crawler): ?Crawler { |
||
26 | |||
27 | if ($crawler->count() === 0) |
||
28 | { |
||
29 | return null; |
||
30 | } |
||
31 | elseif (empty($this->text)) |
||
32 | { |
||
33 | return $crawler; |
||
34 | } |
||
35 | else |
||
36 | { |
||
37 | $text = $this->text; |
||
38 | return $crawler->reduce(function ($node) use ($text) { |
||
39 | return strpos($node->text(), $text) !== false; |
||
40 | }); |
||
44 | } |