• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

MyIntervals / PHP-CSS-Parser / 22065159017

16 Feb 2026 01:45PM UTC coverage: 72.147% (-0.9%) from 73.032%
22065159017

push

github

web-flow
[TASK] Use `addDeclaration()` etc. in tests (#1528)

The methods of the `RuleContainer` interface were renamed in #1521.

1549 of 2147 relevant lines covered (72.15%)

33.62 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/RuleSet/LegacyRuleContainerMethods.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Sabberworm\CSS\RuleSet;
6

7
use Sabberworm\CSS\Property\Declaration;
8

9
/**
10
 * Provides a mapping of the deprecated methods in a `RuleContainer` to their renamed replacements.
11
 */
12
trait LegacyRuleContainerMethods
13
{
14
    /**
15
     * @deprecated in v9.2, will be removed in v10.0; use `addDeclaration()` instead.
16
     */
17
    public function addRule(Declaration $declarationToAdd, ?Declaration $sibling = null): void
×
18
    {
19
        $this->addDeclaration($declarationToAdd, $sibling);
×
20
    }
×
21

22
    /**
23
     * @deprecated in v9.2, will be removed in v10.0; use `removeDeclaration()` instead.
24
     */
25
    public function removeRule(Declaration $declarationToRemove): void
×
26
    {
27
        $this->removeDeclaration($declarationToRemove);
×
28
    }
×
29

30
    /**
31
     * @deprecated in v9.2, will be removed in v10.0; use `removeMatchingDeclarations()` instead.
32
     */
33
    public function removeMatchingRules(string $searchPattern): void
×
34
    {
35
        $this->removeMatchingDeclarations($searchPattern);
×
36
    }
×
37

38
    /**
39
     * @deprecated in v9.2, will be removed in v10.0; use `removeAllDeclarations()` instead.
40
     */
41
    public function removeAllRules(): void
×
42
    {
43
        $this->removeAllDeclarations();
×
44
    }
×
45

46
    /**
47
     * @param array<Declaration> $declarations
48
     *
49
     * @deprecated in v9.2, will be removed in v10.0; use `setDeclarations()` instead.
50
     */
51
    public function setRules(array $declarations): void
×
52
    {
53
        $this->setDeclarations($declarations);
×
54
    }
×
55

56
    /**
57
     * @return array<int<0, max>, Declaration>
58
     *
59
     * @deprecated in v9.2, will be removed in v10.0; use `getDeclarations()` instead.
60
     */
61
    public function getRules(?string $searchPattern = null): array
×
62
    {
63
        return $this->getDeclarations($searchPattern);
×
64
    }
65

66
    /**
67
     * @return array<string, Declaration>
68
     *
69
     * @deprecated in v9.2, will be removed in v10.0; use `getDeclarationsAssociative()` instead.
70
     */
71
    public function getRulesAssoc(?string $searchPattern = null): array
×
72
    {
73
        return $this->getDeclarationsAssociative($searchPattern);
×
74
    }
75
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc