• 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

0.0
/src/Property/CSSNamespace.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Sabberworm\CSS\Property;
6

7
use Sabberworm\CSS\Comment\Comment;
8
use Sabberworm\CSS\OutputFormat;
9

10
/**
11
 * `CSSNamespace` represents an `@namespace` rule.
12
 */
13
class CSSNamespace implements AtRule
14
{
15
    /**
16
     * @var string
17
     */
18
    private $mUrl;
19

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

25
    /**
26
     * @var int
27
     */
28
    private $lineNumber;
29

30
    /**
31
     * @var array<array-key, Comment>
32
     *
33
     * @internal since 8.8.0
34
     */
35
    protected $comments;
36

37
    /**
38
     * @param string $mUrl
39
     * @param string|null $sPrefix
40
     * @param int<0, max> $lineNumber
41
     */
42
    public function __construct($mUrl, $sPrefix = null, $lineNumber = 0)
×
43
    {
44
        $this->mUrl = $mUrl;
×
45
        $this->sPrefix = $sPrefix;
×
46
        $this->lineNumber = $lineNumber;
×
47
        $this->comments = [];
×
48
    }
×
49

50
    /**
51
     * @return int<0, max>
52
     */
53
    public function getLineNo(): int
×
54
    {
55
        return $this->lineNumber;
×
56
    }
57

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

63
    public function render(OutputFormat $outputFormat): string
×
64
    {
65
        return '@namespace ' . ($this->sPrefix === null ? '' : $this->sPrefix . ' ')
×
66
            . $this->mUrl->render($outputFormat) . ';';
×
67
    }
68

69
    /**
70
     * @return string
71
     */
72
    public function getUrl()
×
73
    {
74
        return $this->mUrl;
×
75
    }
76

77
    /**
78
     * @return string|null
79
     */
80
    public function getPrefix()
×
81
    {
82
        return $this->sPrefix;
×
83
    }
84

85
    /**
86
     * @param string $mUrl
87
     */
88
    public function setUrl($mUrl): void
×
89
    {
90
        $this->mUrl = $mUrl;
×
91
    }
×
92

93
    /**
94
     * @param string $sPrefix
95
     */
96
    public function setPrefix($sPrefix): void
×
97
    {
98
        $this->sPrefix = $sPrefix;
×
99
    }
×
100

101
    /**
102
     * @return string
103
     */
104
    public function atRuleName(): string
×
105
    {
106
        return 'namespace';
×
107
    }
108

109
    /**
110
     * @return array<int, string>
111
     */
112
    public function atRuleArgs(): array
×
113
    {
NEW
114
        $result = [$this->mUrl];
×
115
        if ($this->sPrefix) {
×
NEW
116
            \array_unshift($result, $this->sPrefix);
×
117
        }
NEW
118
        return $result;
×
119
    }
120

121
    /**
122
     * @param array<array-key, Comment> $comments
123
     */
124
    public function addComments(array $comments): void
×
125
    {
126
        $this->comments = \array_merge($this->comments, $comments);
×
127
    }
×
128

129
    /**
130
     * @return array<array-key, Comment>
131
     */
132
    public function getComments()
×
133
    {
134
        return $this->comments;
×
135
    }
136

137
    /**
138
     * @param array<array-key, Comment> $comments
139
     */
140
    public function setComments(array $comments): void
×
141
    {
142
        $this->comments = $comments;
×
143
    }
×
144
}
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