<?php
declare(strict_types=1);
namespace League\CommonMark\Node;
final class StringContainerHelper
{
public static function getChildText(Node $node, array $excludeTypes = []): string
{
$text = '';
foreach ($node->iterator() as $child) {
if ($child instanceof StringContainerInterface && ! self::isOneOf($child, $excludeTypes)) {
$text .= $child->getLiteral();
}
}
return $text;
}
private static function isOneOf(object $object, array $classesOrInterfacesToCheck): bool
{