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