| Conditions | 5 |
| Paths | 3 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | 69 | public static function getChildText(Node $node, array $excludeTypes = []): string |
|
| 27 | { |
||
| 28 | 69 | $text = ''; |
|
| 29 | |||
| 30 | 69 | $walker = $node->walker(); |
|
| 31 | 69 | while ($event = $walker->next()) { |
|
| 32 | 69 | if ($event->isEntering() && ($child = $event->getNode()) instanceof StringContainerInterface && ! self::isOneOf($child, $excludeTypes)) { |
|
| 33 | 69 | $text .= $child->getLiteral(); |
|
| 34 | } |
||
| 35 | } |
||
| 36 | |||
| 37 | 69 | return $text; |
|
| 38 | } |
||
| 39 | |||
| 56 |