Conditions | 8 |
Paths | 6 |
Total Lines | 26 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 8 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | 79 | public function get(DOMElement $node): string |
|
12 | { |
||
13 | 79 | $doc = ''; |
|
14 | |||
15 | /** |
||
16 | * @var \DOMNode $childNode |
||
17 | */ |
||
18 | 79 | foreach ($node->childNodes as $childNode) { |
|
19 | 79 | if ($childNode instanceof DOMElement && $childNode->localName == 'annotation') { |
|
20 | /** |
||
21 | * @var \DOMNode $subChildNode |
||
22 | */ |
||
23 | 79 | foreach ($childNode->childNodes as $subChildNode) { |
|
24 | 79 | if ($subChildNode instanceof DOMElement && $subChildNode->localName == 'documentation') { |
|
25 | 78 | if (!empty($doc)) { |
|
26 | 74 | $doc .= "\n".($subChildNode->nodeValue); |
|
27 | } else { |
||
28 | 79 | $doc .= ($subChildNode->nodeValue); |
|
29 | } |
||
30 | } |
||
31 | } |
||
32 | } |
||
33 | } |
||
34 | 79 | $doc = preg_replace('/[\t ]+/', ' ', $doc); |
|
35 | |||
36 | 79 | return trim($doc); |
|
37 | } |
||
39 |