Skip to content

Commit 0d850c5

Browse files
committed
[TASK] Deprecate passing Rule to RuleSet::getRules()
Relates to #1247.
1 parent 9dbc6a6 commit 0d850c5

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ Please also have a look at our
4646

4747
### Deprecated
4848

49+
- Passing a `Rule` to `RuleSet::getRules()` is deprecated,
50+
affecting the implementing classes `AtRuleSet` and `DeclarationBlock`
51+
(call `getRules($rule->getRule())` instead) (#1248)
4952
- Passing a string as the first argument to `getAllValues()` is deprecated;
5053
the search pattern should now be passed as the second argument (#1241)
5154
- Passing a Boolean as the second argument to `getAllValues()` is deprecated;

src/RuleSet/RuleSet.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ public function addRule(Rule $ruleToAdd, ?Rule $sibling = null): void
135135
* Pattern to search for. If null, returns all rules.
136136
* If the pattern ends with a dash, all rules starting with the pattern are returned
137137
* as well as one matching the pattern with the dash excluded.
138-
* Passing a `Rule` behaves like calling `getRules($rule->getRule())`.
138+
* Passing a `Rule` for this parameter is deprecated in version 8.9.0, and will not work from v9.0.
139+
* Call `getRules($rule->getRule())` instead.
139140
*
140141
* @return array<int<0, max>, Rule>
141142
*/

0 commit comments

Comments
 (0)