• 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/Property/Import.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
use Sabberworm\CSS\Value\URL;
10

11
/**
12
 * Class representing an `@import` rule.
13
 */
14
class Import implements AtRule
15
{
16
    /**
17
     * @var URL
18
     */
19
    private $oLocation;
20

21
    /**
22
     * @var string
23
     */
24
    private $sMediaQuery;
25

26
    /**
27
     * @var int
28
     */
29
    protected $lineNumber;
30

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

36
    /**
37
     * @param URL $oLocation
38
     * @param string $sMediaQuery
39
     * @param int $lineNumber
40
     */
NEW
41
    public function __construct(URL $oLocation, $sMediaQuery, $lineNumber = 0)
×
42
    {
43
        $this->oLocation = $oLocation;
×
44
        $this->sMediaQuery = $sMediaQuery;
×
NEW
45
        $this->lineNumber = $lineNumber;
×
46
        $this->comments = [];
×
47
    }
×
48

49
    /**
50
     * @return int
51
     */
52
    public function getLineNo()
×
53
    {
NEW
54
        return $this->lineNumber;
×
55
    }
56

57
    /**
58
     * @param URL $oLocation
59
     */
60
    public function setLocation($oLocation): void
×
61
    {
62
        $this->oLocation = $oLocation;
×
63
    }
×
64

65
    /**
66
     * @return URL
67
     */
68
    public function getLocation()
×
69
    {
70
        return $this->oLocation;
×
71
    }
72

73
    public function __toString(): string
×
74
    {
75
        return $this->render(new OutputFormat());
×
76
    }
77

78
    public function render(OutputFormat $oOutputFormat): string
×
79
    {
80
        return $oOutputFormat->comments($this) . '@import ' . $this->oLocation->render($oOutputFormat)
×
81
            . ($this->sMediaQuery === null ? '' : ' ' . $this->sMediaQuery) . ';';
×
82
    }
83

84
    public function atRuleName(): string
×
85
    {
86
        return 'import';
×
87
    }
88

89
    /**
90
     * @return array<int, URL|string>
91
     */
92
    public function atRuleArgs(): array
×
93
    {
94
        $aResult = [$this->oLocation];
×
95
        if ($this->sMediaQuery) {
×
96
            \array_push($aResult, $this->sMediaQuery);
×
97
        }
98
        return $aResult;
×
99
    }
100

101
    /**
102
     * @param array<array-key, Comment> $comments
103
     */
104
    public function addComments(array $comments): void
×
105
    {
106
        $this->comments = \array_merge($this->comments, $comments);
×
107
    }
×
108

109
    /**
110
     * @return array<array-key, Comment>
111
     */
112
    public function getComments()
×
113
    {
114
        return $this->comments;
×
115
    }
116

117
    /**
118
     * @param array<array-key, Comment> $comments
119
     */
120
    public function setComments(array $comments): void
×
121
    {
122
        $this->comments = $comments;
×
123
    }
×
124

125
    /**
126
     * @return string
127
     */
128
    public function getMediaQuery()
×
129
    {
130
        return $this->sMediaQuery;
×
131
    }
132
}
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

© 2026 Coveralls, Inc