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

MyIntervals / PHP-CSS-Parser / 12973829822

26 Jan 2025 10:32AM UTC coverage: 42.018% (-0.2%) from 42.261%
12973829822

Pull #809

github

web-flow
Merge 1b26da12f into 7c6845f83
Pull Request #809: [BUGFIX] Drop `@covers` annotation referencing inexistent method

866 of 2061 relevant lines covered (42.02%)

6.56 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 $iLineNo;
29

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

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

48
    /**
49
     * @return int
50
     */
51
    public function getLineNo()
×
52
    {
53
        return $this->iLineNo;
×
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
        return '@namespace ' . ($this->sPrefix === null ? '' : $this->sPrefix . ' ')
×
64
            . $this->mUrl->render($oOutputFormat) . ';';
×
65
    }
66

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

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

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

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

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

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

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

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

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