private function isRequiredAttr(string $tag, string $attr) : bool
{
if (isset($this->requiredAttrs[$tag])) {
if (is_array($this->requiredAttrs[$tag])) {
return in_array($attr, $this->requiredAttrs[$tag]);
}
return $attr == $this->requiredAttrs[$tag];
}
return false;
}