tagName) !== 'label') { return null; } $html = $element->ownerDocument ? $element->ownerDocument->saveHTML($element) : ''; if ($html !== false && preg_match('/<\?php|\{\{|\{%/i', $html)) { return null; } $text = trim($element->textContent); if ($text === '') { return $this->createViolation( $element, $this->getDescription(), 'Add text content to the label element to describe its associated input.' ); } return null; } }