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