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

MyIntervals / PHP-CSS-Parser / 13334861064

14 Feb 2025 06:08PM UTC coverage: 50.421%. Remained the same
13334861064

push

github

web-flow
[CLEANUP] Avoid Hungarian notation for `result` (#924)

Part of #756

Co-authored-by: JakeQZ <jake.github@qzdesign.co.uk>

49 of 100 new or added lines in 13 files covered. (49.0%)

2 existing lines in 2 files now uncovered.

958 of 1900 relevant lines covered (50.42%)

11.51 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 $arguments;
24

25
    /**
26
     * @param string $type
27
     * @param string $arguments
28
     * @param int<0, max> $lineNumber
29
     */
30
    public function __construct($type, $arguments = '', $lineNumber = 0)
11✔
31
    {
32
        parent::__construct($lineNumber);
11✔
33
        $this->type = $type;
11✔
34
        $this->arguments = $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->arguments;
2✔
51
    }
52

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

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