Conditions | 5 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 30 |
Changes | 0 |
1 | <?php |
||
67 | public function __invoke($value): array |
||
68 | { |
||
69 | $dom = new DOMDocument(); |
||
70 | $dom->loadHTML($value); |
||
71 | $values = []; |
||
72 | |||
73 | foreach ($this->tags as $tag) { |
||
74 | foreach ($dom->getElementsByTagName($tag) as $node) { |
||
75 | $values[] = $node->textContent; |
||
76 | |||
77 | while (($node = $node->nextSibling) && $node->nodeName !== $tag) { |
||
78 | $values[] = $node->textContent; |
||
79 | } |
||
80 | } |
||
81 | } |
||
82 | |||
83 | return $values; |
||
84 | } |
||
86 |