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