element or element with role="main".'; } public function getStandard(): WCAGStandard { return WCAGStandard::A; } public function getSeverity(): Severity { return Severity::WARNING; } public function getLevel(): int { return 3; } public function check(DOMElement $element): ?Violation { if (strtolower($element->tagName) !== 'html') { return null; } $doc = $element->ownerDocument; if ($doc === null) { return null; } $xpath = new DOMXPath($doc); $mains = $xpath->query('//main | //*[@role="main"]'); if ($mains === false || $mains->length === 0) { return $this->createViolation( $element, 'Sayfada
alanı bulunamadı.', 'Add exactly one
element or element with role="main" to the page.' ); } elseif ($mains->length > 1) { return $this->createViolation( $element, 'Sayfada birden fazla
alanı bulundu.', 'Ensure there is only one
element or element with role="main" per page.' ); } return null; } }