Debian Codegraph @

vendor/sabberworm/php-css-parser/src/RuleSet/DeclarationList.php

raw
1 <?php
2
3 declare(strict_types=1);
4
5 namespace Sabberworm\CSS\RuleSet;
6
7 use Sabberworm\CSS\Property\Declaration;
8
9 /**
10 * Represents a CSS item that contains `Declaration`s, defining the methods to manipulate them.
11 */
12 interface DeclarationList
13 {
14 public function addDeclaration(Declaration $declarationToAdd, ?Declaration $sibling = null): void;
15
16 public function removeDeclaration(Declaration $declarationToRemove): void;
17
18 public function removeMatchingDeclarations(string $searchPattern): void;
19
20 public function removeAllDeclarations(): void;
21
22 /**
23 * @param array<Declaration> $declarations
24 */
25 public function setDeclarations(array $declarations): void;
26
27 /**
28 * @return array<int<0, max>, Declaration>
29 */
30 public function getDeclarations(?string $searchPattern = null): array;
31
32 /**
33 * @return array<string, Declaration>
34 */
35 public function getDeclarationsAssociative(?string $searchPattern = null): array;
36
37 /**
38 * @deprecated in v9.2, will be removed in v10.0; use `addDeclaration()` instead.
39 */
40 public function addRule(Declaration $declarationToAdd, ?Declaration $sibling = null): void;
41
42 /**
43 * @deprecated in v9.2, will be removed in v10.0; use `removeDeclaration()` instead.
44 */
45 public function removeRule(Declaration $declarationToRemove): void;
46
47 /**
48 * @deprecated in v9.2, will be removed in v10.0; use `removeMatchingDeclarations()` instead.
49 */
50 public function removeMatchingRules(string $searchPattern): void;
51
52 /**
53 * @deprecated in v9.2, will be removed in v10.0; use `removeAllDeclarations()` instead.
54 */
55 public function removeAllRules(): void;
56
57 /**
58 * @param array<Declaration> $declarations
59 *
60 * @deprecated in v9.2, will be removed in v10.0; use `setDeclarations()` instead.
61 */
62 public function setRules(array $declarations): void;
63
64 /**
65 * @return array<int<0, max>, Declaration>
66 *
67 * @deprecated in v9.2, will be removed in v10.0; use `getDeclarations()` instead.
68 */
69 public function getRules(?string $searchPattern = null): array;
70
71 /**
72 * @return array<string, Declaration>
73 *
74 * @deprecated in v9.2, will be removed in v10.0; use `getDeclarationsAssociative()` instead.
75 */
76 public function getRulesAssoc(?string $searchPattern = null): array;
77 }