-
Notifications
You must be signed in to change notification settings - Fork 152
Expand file tree
/
Copy pathLegacyDeclarationListMethods.php
More file actions
75 lines (65 loc) · 2.06 KB
/
Copy pathLegacyDeclarationListMethods.php
File metadata and controls
75 lines (65 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
declare(strict_types=1);
namespace Sabberworm\CSS\RuleSet;
use Sabberworm\CSS\Property\Declaration;
/**
* Provides a mapping of the deprecated methods in a `DeclarationList` to their renamed replacements.
*/
trait LegacyDeclarationListMethods
{
/**
* @deprecated in v9.2, will be removed in v10.0; use `addDeclaration()` instead.
*/
public function addRule(Declaration $declarationToAdd, ?Declaration $sibling = null): void
{
$this->addDeclaration($declarationToAdd, $sibling);
}
/**
* @deprecated in v9.2, will be removed in v10.0; use `removeDeclaration()` instead.
*/
public function removeRule(Declaration $declarationToRemove): void
{
$this->removeDeclaration($declarationToRemove);
}
/**
* @deprecated in v9.2, will be removed in v10.0; use `removeMatchingDeclarations()` instead.
*/
public function removeMatchingRules(string $searchPattern): void
{
$this->removeMatchingDeclarations($searchPattern);
}
/**
* @deprecated in v9.2, will be removed in v10.0; use `removeAllDeclarations()` instead.
*/
public function removeAllRules(): void
{
$this->removeAllDeclarations();
}
/**
* @param array<Declaration> $declarations
*
* @deprecated in v9.2, will be removed in v10.0; use `setDeclarations()` instead.
*/
public function setRules(array $declarations): void
{
$this->setDeclarations($declarations);
}
/**
* @return array<int<0, max>, Declaration>
*
* @deprecated in v9.2, will be removed in v10.0; use `getDeclarations()` instead.
*/
public function getRules(?string $searchPattern = null): array
{
return $this->getDeclarations($searchPattern);
}
/**
* @return array<string, Declaration>
*
* @deprecated in v9.2, will be removed in v10.0; use `getDeclarationsAssociative()` instead.
*/
public function getRulesAssoc(?string $searchPattern = null): array
{
return $this->getDeclarationsAssociative($searchPattern);
}
}