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

MyIntervals / PHP-CSS-Parser / 12996244771

27 Jan 2025 06:56PM UTC coverage: 51.041%. Remained the same
12996244771

push

github

web-flow
[CLEANUP] Avoid Hungarian notation for `iLineNo` (#833)

Part of #756

30 of 79 new or added lines in 25 files covered. (37.97%)

1 existing line in 1 file now uncovered.

1054 of 2065 relevant lines covered (51.04%)

10.55 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 $lineNumber
32
     */
NEW
33
    public function __construct($sType, $sArgs = '', $lineNumber = 0)
×
34
    {
NEW
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

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