public static function getDOMChildren(\DOMElement $element, $localName, $namespaceURI)
{
if (!$element instanceof \DOMElement || !is_string($localName) || !is_string($namespaceURI)) {
throw new \InvalidArgumentException('Invalid input parameters.');
}
$ret = array();
for ($i = 0; $i < $element->childNodes->length; $i++) {
$child = $element->childNodes->item($i);
// skip text nodes and comment elements
if ($child instanceof \DOMText || $child instanceof \DOMComment) {
continue;
}
if (self::isDOMElementOfType($child, $localName, $namespaceURI) === true) {
$ret[] = $child;
}
}
return $ret;
}