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

MyIntervals / PHP-CSS-Parser / 13533499427

26 Feb 2025 12:08AM UTC coverage: 54.627%. Remained the same
13533499427

push

github

web-flow
[CLEANUP] Avoid Hungarian notation in `AtRuleSet` (#997)

Part of #756

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

1039 of 1902 relevant lines covered (54.63%)

12.11 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
     */
NEW
33
    public function __construct($type, $arguments = '', $lineNumber = 0)
×
34
    {
35
        parent::__construct($lineNumber);
×
NEW
36
        $this->type = $type;
×
37
        $this->arguments = $arguments;
×
38
    }
×
39

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

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

56
    public function __toString(): string
×
57
    {
58
        return $this->render(new OutputFormat());
×
59
    }
60

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