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

MyIntervals / PHP-CSS-Parser / 13630179707

03 Mar 2025 11:48AM UTC coverage: 56.519% (+0.7%) from 55.808%
13630179707

Pull #1046

github

web-flow
Merge ab450d0c0 into 86aeaa791
Pull Request #1046: [TASK] Remove `__toString()`

1049 of 1856 relevant lines covered (56.52%)

12.38 hits per line

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

50.0
/src/CSSList/AtRuleBlockList.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Sabberworm\CSS\CSSList;
6

7
use Sabberworm\CSS\OutputFormat;
8
use Sabberworm\CSS\Property\AtRule;
9

10
/**
11
 * A `BlockList` constructed by an unknown at-rule. `@media` rules are rendered into `AtRuleBlockList` objects.
12
 */
13
class AtRuleBlockList extends CSSBlockList implements AtRule
14
{
15
    /**
16
     * @var string
17
     */
18
    private $type;
19

20
    /**
21
     * @var string
22
     */
23
    private $arguments;
24

25
    /**
26
     * @param int<0, max> $lineNumber
27
     */
28
    public function __construct(string $type, string $arguments = '', int $lineNumber = 0)
18✔
29
    {
30
        parent::__construct($lineNumber);
18✔
31
        $this->type = $type;
18✔
32
        $this->arguments = $arguments;
18✔
33
    }
18✔
34

35
    public function atRuleName(): string
3✔
36
    {
37
        return $this->type;
3✔
38
    }
39

40
    public function atRuleArgs(): string
4✔
41
    {
42
        return $this->arguments;
4✔
43
    }
44

45
    public function render(OutputFormat $outputFormat): string
×
46
    {
47
        $result = $outputFormat->comments($this);
×
48
        $result .= $outputFormat->getBeforeAtRuleBlock();
×
49
        $arguments = $this->arguments;
×
50
        if ($arguments) {
×
51
            $arguments = ' ' . $arguments;
×
52
        }
53
        $result .= "@{$this->type}$arguments{$outputFormat->spaceBeforeOpeningBrace()}{";
×
54
        $result .= $this->renderListContents($outputFormat);
×
55
        $result .= '}';
×
56
        $result .= $outputFormat->getAfterAtRuleBlock();
×
57
        return $result;
×
58
    }
59

60
    public function isRootList(): bool
1✔
61
    {
62
        return false;
1✔
63
    }
64
}
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