Skip to content

Commit eaa13f3

Browse files
authored
[TASK] Use DeclarationList in the source code (#1539)
The interface was renamed from `RuleContainer` in #1530. Also rename the trait that transitionally provides a mapping for the methods deprecated in #1521 for the implementing classes.
1 parent 69f4ed8 commit eaa13f3

5 files changed

Lines changed: 9 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Please also have a look at our
1818

1919
### Changed
2020

21-
- `RuleSet\RuleContainer` is renamed to `RuleSet\DeclarationList` (#1530)
21+
- `RuleSet\RuleContainer` is renamed to `RuleSet\DeclarationList` (#1530, #1539)
2222
- Methods like `setRule()` in `RuleSet` and `DeclarationBlock` have been renamed
2323
to `setDeclaration()`, etc. (#1521)
2424
- `Rule\Rule` class is renamed to `Property\Declaration`

src/CSSList/CSSBlockList.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Sabberworm\CSS\Property\Declaration;
99
use Sabberworm\CSS\Property\Selector;
1010
use Sabberworm\CSS\RuleSet\DeclarationBlock;
11-
use Sabberworm\CSS\RuleSet\RuleContainer;
11+
use Sabberworm\CSS\RuleSet\DeclarationList;
1212
use Sabberworm\CSS\RuleSet\RuleSet;
1313
use Sabberworm\CSS\Value\CSSFunction;
1414
use Sabberworm\CSS\Value\Value;
@@ -98,7 +98,7 @@ public function getAllValues(
9898
);
9999
}
100100
}
101-
} elseif ($element instanceof RuleContainer) {
101+
} elseif ($element instanceof DeclarationList) {
102102
foreach ($element->getRules($ruleSearchPattern) as $rule) {
103103
$result = \array_merge(
104104
$result,

src/RuleSet/DeclarationBlock.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232
*
3333
* Note that `CSSListItem` extends both `Commentable` and `Renderable`, so those interfaces must also be implemented.
3434
*/
35-
class DeclarationBlock implements CSSElement, CSSListItem, Positionable, RuleContainer
35+
class DeclarationBlock implements CSSElement, CSSListItem, Positionable, DeclarationList
3636
{
3737
use CommentContainer;
38-
use LegacyRuleContainerMethods;
38+
use LegacyDeclarationListMethods;
3939
use Position;
4040

4141
/**

src/RuleSet/LegacyRuleContainerMethods.php renamed to src/RuleSet/LegacyDeclarationListMethods.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
use Sabberworm\CSS\Property\Declaration;
88

99
/**
10-
* Provides a mapping of the deprecated methods in a `RuleContainer` to their renamed replacements.
10+
* Provides a mapping of the deprecated methods in a `DeclarationList` to their renamed replacements.
1111
*/
12-
trait LegacyRuleContainerMethods
12+
trait LegacyDeclarationListMethods
1313
{
1414
/**
1515
* @deprecated in v9.2, will be removed in v10.0; use `addDeclaration()` instead.

src/RuleSet/RuleSet.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
*
2727
* Note that `CSSListItem` extends both `Commentable` and `Renderable`, so those interfaces must also be implemented.
2828
*/
29-
class RuleSet implements CSSElement, CSSListItem, Positionable, RuleContainer
29+
class RuleSet implements CSSElement, CSSListItem, Positionable, DeclarationList
3030
{
3131
use CommentContainer;
32-
use LegacyRuleContainerMethods;
32+
use LegacyDeclarationListMethods;
3333
use Position;
3434

3535
/**

0 commit comments

Comments
 (0)