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