File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 25
25
abstract class RuleSet implements Renderable, Commentable
26
26
{
27
27
/**
28
- * the rules in this rule set, using the property name as the key
28
+ * the rules in this rule set, using the property or rule name as the key
29
29
*
30
30
* @var array<string, Rule>
31
31
*/
@@ -155,15 +155,15 @@ public function getRules($searchPattern = null)
155
155
}
156
156
/** @var array<int, Rule> $result */
157
157
$ result = [];
158
- foreach ($ this ->rules as $ propertyName => $ rule ) {
158
+ foreach ($ this ->rules as $ propertyOrRuleName => $ rule ) {
159
159
// Either no search rule is given or the search rule matches the found rule exactly
160
160
// or the search rule ends in “-” and the found rule starts with the search rule.
161
161
if (
162
- !$ searchPattern || $ propertyName === $ searchPattern
162
+ !$ searchPattern || $ propertyOrRuleName === $ searchPattern
163
163
|| (
164
164
\strrpos ($ searchPattern , '- ' ) === \strlen ($ searchPattern ) - \strlen ('- ' )
165
- && (\strpos ($ propertyName , $ searchPattern ) === 0
166
- || $ propertyName === \substr ($ searchPattern , 0 , -1 ))
165
+ && (\strpos ($ propertyOrRuleName , $ searchPattern ) === 0
166
+ || $ propertyOrRuleName === \substr ($ searchPattern , 0 , -1 ))
167
167
)
168
168
) {
169
169
$ result = \array_merge ($ result , $ rule );
You can’t perform that action at this time.
0 commit comments