Skip to content

Commit 3d6fd81

Browse files
committed
refactor(a11y): improve condition checks in accessibility rules for clarity
1 parent 91a13b8 commit 3d6fd81

4 files changed

Lines changed: 7 additions & 0 deletions

File tree

src/Rules/Aria/AriaErrorMessageIdExistsRule.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public function evaluate(Tokens $tokens, int $tokenIndex, callable $emit): void
3333
if ('' === $refId) {
3434
continue;
3535
}
36+
3637
if (isset($ids[$refId])) {
3738
continue;
3839
}

src/Rules/Forms/InvalidFieldErrorMessageRule.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,11 @@ public function evaluate(Tokens $tokens, int $tokenIndex, callable $emit): void
5151
if (!$this->isSupportedField($tagName, $tag)) {
5252
continue;
5353
}
54+
5455
if ($this->hasNonEmptyReference($tag, 'aria-describedby')) {
5556
continue;
5657
}
58+
5759
if ($this->hasNonEmptyReference($tag, 'aria-errormessage')) {
5860
continue;
5961
}

src/Rules/Forms/RadioGroupAccessibleNameRule.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,11 @@ public function evaluate(Tokens $tokens, int $tokenIndex, callable $emit): void
5858
if ($radioCount < 2) {
5959
continue;
6060
}
61+
6162
if ($this->hasNonEmptyReference($groupBlock, 'aria-labelledby')) {
6263
continue;
6364
}
65+
6466
if ($this->hasNonEmptyReference($groupBlock, 'aria-label')) {
6567
continue;
6668
}

src/Rules/Forms/RadioGroupStructureRule.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ public function evaluate(Tokens $tokens, int $tokenIndex, callable $emit): void
4242
if (count($items) < 2) {
4343
continue;
4444
}
45+
4546
if ($this->isInsideFieldsetGroup($full, $name)) {
4647
continue;
4748
}
49+
4850
if ($this->isInsideAriaRadioGroup($full, $name)) {
4951
continue;
5052
}

0 commit comments

Comments
 (0)