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