ownerDocument; $html = ''; if ($doc !== null) { $htmlVal = $doc->saveHTML($element); if (is_string($htmlVal)) { $html = $htmlVal; } } return new Violation( ruleId: $this->getId(), message: $message, severity: $this->getSeverity(), standard: $this->getStandard(), htmlSnippet: $html, fixSuggestion: $suggestion ); } }