Skip to content

Commit 6d0cbdd

Browse files
committed
Improve code
1 parent e4a0b2b commit 6d0cbdd

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Rules.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,13 @@ public function __construct(array $rules)
9696
*/
9797
public function supports(string $section): bool
9898
{
99-
return self::ALL_DOMAINS === $section
100-
|| (isset($this->rules[$section]) && is_array($this->rules[$section]) && !empty($this->rules[$section]));
99+
if (self::ALL_DOMAINS === $section) {
100+
return true;
101+
}
102+
103+
$rules = $this->rules[$section] ?? null;
104+
105+
return !(null === $rules || !is_array($rules) || empty($rules));
101106
}
102107

103108
/**

0 commit comments

Comments
 (0)