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