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

MyIntervals / PHP-CSS-Parser / 13957957423

19 Mar 2025 10:31PM UTC coverage: 51.499%. Remained the same
13957957423

push

github

web-flow
[CLEANUP] And some more annotations for non-empty strings (#1199)

945 of 1835 relevant lines covered (51.5%)

6.71 hits per line

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

47.83
/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 non-empty-string
17
     */
18
    private $type;
19

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

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

36
    /**
37
     * @return non-empty-string
38
     */
39
    public function atRuleName(): string
3✔
40
    {
41
        return $this->type;
3✔
42
    }
43

44
    public function atRuleArgs(): string
4✔
45
    {
46
        return $this->arguments;
4✔
47
    }
48

49
    /**
50
     * @return non-empty-string
51
     */
52
    public function render(OutputFormat $outputFormat): string
×
53
    {
54
        $formatter = $outputFormat->getFormatter();
×
55
        $result = $formatter->comments($this);
×
56
        $result .= $outputFormat->getContentBeforeAtRuleBlock();
×
57
        $arguments = $this->arguments;
×
58
        if ($arguments) {
×
59
            $arguments = ' ' . $arguments;
×
60
        }
61
        $result .= "@{$this->type}$arguments{$formatter->spaceBeforeOpeningBrace()}{";
×
62
        $result .= $this->renderListContents($outputFormat);
×
63
        $result .= '}';
×
64
        $result .= $outputFormat->getContentAfterAtRuleBlock();
×
65
        return $result;
×
66
    }
67

68
    public function isRootList(): bool
1✔
69
    {
70
        return false;
1✔
71
    }
72
}
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

© 2025 Coveralls, Inc