public static function get_nodes_by_class($parent, $class=null, bool $all=false) {
		$nodes = array();

		if (! \method_exists($parent, 'getElementsByTagName')) {
			return $nodes;
		}

		ref\cast::array($class);
		$class = \array_map('trim', $class);
		foreach ($class as $k=>$v) {
			$class[$k] = \ltrim($class[$k], '.');
		}
		$class = \array_filter($class, 'strlen');
		\sort($class);
		$class = \array_unique($class);
		if (! \count($class)) {
			return $nodes;
		}

		$possible = $parent->getElementsByTagName('*');
		if ($possible->length) {
			foreach ($possible as $child) {
				if ($child->hasAttribute('class')) {
					$classes = $child->getAttribute('class');
					ref\sanitize::whitespace($classes);
					$classes = \explode(' ', $classes);
					$overlap = \array_intersect($classes, $class);

					if (\count($overlap) && (! $all || \count($overlap) === \count($class))) {
						$nodes[] = $child;
					}
				}
			}
		}

		return $nodes;
	}