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

MyIntervals / PHP-CSS-Parser / 13716838860

07 Mar 2025 08:35AM UTC coverage: 55.626%. Remained the same
13716838860

Pull #1105

github

web-flow
Merge 26aa3cb2a into 4f45adbf3
Pull Request #1105: [CLEANUP] Avoid Hungarian notation in `DeclarationBlock`

4 of 4 new or added lines in 1 file covered. (100.0%)

1053 of 1893 relevant lines covered (55.63%)

12.21 hits per line

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

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

3
declare(strict_types=1);
4

5
namespace Sabberworm\CSS\RuleSet;
6

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

10
/**
11
 * This class represents rule sets for generic at-rules which are not covered by specific classes, i.e., not
12
 * `@import`, `@charset` or `@media`.
13
 *
14
 * A common example for this is `@font-face`.
15
 */
16
class AtRuleSet extends RuleSet implements AtRule
17
{
18
    /**
19
     * @var string
20
     */
21
    private $type;
22

23
    /**
24
     * @var string
25
     */
26
    private $arguments;
27

28
    /**
29
     * @param string $type
30
     * @param string $arguments
31
     * @param int<0, max> $lineNumber
32
     */
33
    public function __construct($type, $arguments = '', $lineNumber = 0)
×
34
    {
35
        parent::__construct($lineNumber);
×
36
        $this->type = $type;
×
37
        $this->arguments = $arguments;
×
38
    }
×
39

40
    /**
41
     * @return string
42
     */
43
    public function atRuleName()
×
44
    {
45
        return $this->type;
×
46
    }
47

48
    /**
49
     * @return string
50
     */
51
    public function atRuleArgs()
×
52
    {
53
        return $this->arguments;
×
54
    }
55

56
    /**
57
     * @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead.
58
     */
59
    public function __toString(): string
×
60
    {
61
        return $this->render(new OutputFormat());
×
62
    }
63

64
    public function render(OutputFormat $outputFormat): string
×
65
    {
66
        $result = $outputFormat->comments($this);
×
67
        $arguments = $this->arguments;
×
68
        if ($arguments) {
×
69
            $arguments = ' ' . $arguments;
×
70
        }
71
        $result .= "@{$this->type}$arguments{$outputFormat->spaceBeforeOpeningBrace()}{";
×
72
        $result .= $this->renderRules($outputFormat);
×
73
        $result .= '}';
×
74
        return $result;
×
75
    }
76
}
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