@@ -151,14 +151,13 @@ public function addRule(Rule $ruleToAdd, ?Rule $sibling = null): void
151
151
* as well as one matching the pattern with the dash excluded.
152
152
* Passing a `Rule` behaves like calling `getRules($rule->getRule())`.
153
153
*
154
- * @return array<int, Rule>
154
+ * @return array<int<0, max> , Rule>
155
155
*/
156
- public function getRules ($ searchPattern = null )
156
+ public function getRules ($ searchPattern = null ): array
157
157
{
158
158
if ($ searchPattern instanceof Rule) {
159
159
$ searchPattern = $ searchPattern ->getRule ();
160
160
}
161
- /** @var array<int, Rule> $result */
162
161
$ result = [];
163
162
foreach ($ this ->rules as $ propertyName => $ rules ) {
164
163
// Either no search rule is given or the search rule matches the found rule exactly
@@ -187,7 +186,7 @@ public function getRules($searchPattern = null)
187
186
/**
188
187
* Overrides all the rules of this set.
189
188
*
190
- * @param array<array-key, Rule> $rules The rules to override with.
189
+ * @param array<Rule> $rules The rules to override with.
191
190
*/
192
191
public function setRules (array $ rules ): void
193
192
{
@@ -212,13 +211,14 @@ public function setRules(array $rules): void
212
211
*
213
212
* @return array<string, Rule>
214
213
*/
215
- public function getRulesAssoc ($ searchPattern = null )
214
+ public function getRulesAssoc ($ searchPattern = null ): array
216
215
{
217
216
/** @var array<string, Rule> $result */
218
217
$ result = [];
219
218
foreach ($ this ->getRules ($ searchPattern ) as $ rule ) {
220
219
$ result [$ rule ->getRule ()] = $ rule ;
221
220
}
221
+
222
222
return $ result ;
223
223
}
224
224
0 commit comments