diff --git a/CHANGELOG.md b/CHANGELOG.md index f9f1d0de..e39699b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,7 +34,7 @@ Please also have a look at our - Use more native type declarations and strict mode (#641, #772, #774, #778, #804, #841, #873, #875, #891, #922, #923, #933, #958, #964, #967, #1000, #1044, #1134, #1136, #1137, #1139, #1140, #1141, #1145, - #1162, #1163, #1166, #1172, #1174, #1178, #1179, #1181, #1183, #1184) + #1162, #1163, #1166, #1172, #1174, #1178, #1179, #1181, #1183, #1184, #1186) - Add visibility to all class/interface constants (#469) ### Deprecated diff --git a/src/RuleSet/RuleSet.php b/src/RuleSet/RuleSet.php index 622f9f16..1b071cbb 100644 --- a/src/RuleSet/RuleSet.php +++ b/src/RuleSet/RuleSet.php @@ -151,14 +151,13 @@ public function addRule(Rule $ruleToAdd, ?Rule $sibling = null): void * as well as one matching the pattern with the dash excluded. * Passing a `Rule` behaves like calling `getRules($rule->getRule())`. * - * @return array + * @return array, Rule> */ - public function getRules($searchPattern = null) + public function getRules($searchPattern = null): array { if ($searchPattern instanceof Rule) { $searchPattern = $searchPattern->getRule(); } - /** @var array $result */ $result = []; foreach ($this->rules as $propertyName => $rules) { // Either no search rule is given or the search rule matches the found rule exactly @@ -187,7 +186,7 @@ public function getRules($searchPattern = null) /** * Overrides all the rules of this set. * - * @param array $rules The rules to override with. + * @param array $rules The rules to override with. */ public function setRules(array $rules): void { @@ -212,13 +211,14 @@ public function setRules(array $rules): void * * @return array */ - public function getRulesAssoc($searchPattern = null) + public function getRulesAssoc($searchPattern = null): array { /** @var array $result */ $result = []; foreach ($this->getRules($searchPattern) as $rule) { $result[$rule->getRule()] = $rule; } + return $result; }