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

MyIntervals / PHP-CSS-Parser / 13267478804

11 Feb 2025 04:17PM UTC coverage: 49.156%. Remained the same
13267478804

Pull #910

github

web-flow
Merge ed5dea74d into b3e83b867
Pull Request #910: [CLEANUP] Avoid Hungarian notation for `outputFormat`

22 of 58 new or added lines in 18 files covered. (37.93%)

1 existing line in 1 file now uncovered.

932 of 1896 relevant lines covered (49.16%)

11.42 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 $sType;
22

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

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

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

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

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

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