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

MyIntervals / PHP-CSS-Parser / 12970174885

26 Jan 2025 01:26AM UTC coverage: 42.261%. Remained the same
12970174885

push

github

web-flow
[CLEANUP] Avoid Hungarian notation in `AtRuleBlockList` (#812)

Part of #756.

5 of 6 new or added lines in 1 file covered. (83.33%)

871 of 2061 relevant lines covered (42.26%)

6.58 hits per line

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

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

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

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

37
    /**
38
     * @return string
39
     */
40
    public function atRuleName()
2✔
41
    {
42
        return $this->type;
2✔
43
    }
44

45
    /**
46
     * @return string
47
     */
48
    public function atRuleArgs()
2✔
49
    {
50
        return $this->sArgs;
2✔
51
    }
52

53
    public function __toString(): string
×
54
    {
55
        return $this->render(new OutputFormat());
×
56
    }
57

58
    public function render(OutputFormat $oOutputFormat): string
×
59
    {
60
        $sResult = $oOutputFormat->comments($this);
×
61
        $sResult .= $oOutputFormat->sBeforeAtRuleBlock;
×
62
        $sArgs = $this->sArgs;
×
63
        if ($sArgs) {
×
64
            $sArgs = ' ' . $sArgs;
×
65
        }
NEW
66
        $sResult .= "@{$this->type}$sArgs{$oOutputFormat->spaceBeforeOpeningBrace()}{";
×
67
        $sResult .= $this->renderListContents($oOutputFormat);
×
68
        $sResult .= '}';
×
69
        $sResult .= $oOutputFormat->sAfterAtRuleBlock;
×
70
        return $sResult;
×
71
    }
72

73
    public function isRootList(): bool
×
74
    {
75
        return false;
×
76
    }
77
}
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