• 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/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 $location;
20

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

26
    /**
27
     * @var int<0, max>
28
     *
29
     * @internal since 8.8.0
30
     */
31
    protected $lineNumber;
32

33
    /**
34
     * @var array<array-key, Comment>
35
     *
36
     * @internal since 8.8.0
37
     */
38
    protected $comments;
39

40
    /**
41
     * @param string $mediaQuery
42
     * @param int<0, max> $lineNumber
43
     */
44
    public function __construct(URL $location, $mediaQuery, $lineNumber = 0)
×
45
    {
46
        $this->location = $location;
×
47
        $this->mediaQuery = $mediaQuery;
×
48
        $this->lineNumber = $lineNumber;
×
49
        $this->comments = [];
×
50
    }
×
51

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

60
    /**
61
     * @param URL $location
62
     */
63
    public function setLocation($location): void
×
64
    {
65
        $this->location = $location;
×
66
    }
×
67

68
    /**
69
     * @return URL
70
     */
71
    public function getLocation()
×
72
    {
73
        return $this->location;
×
74
    }
75

76
    public function __toString(): string
×
77
    {
78
        return $this->render(new OutputFormat());
×
79
    }
80

81
    public function render(OutputFormat $outputFormat): string
×
82
    {
83
        return $outputFormat->comments($this) . '@import ' . $this->location->render($outputFormat)
×
84
            . ($this->mediaQuery === null ? '' : ' ' . $this->mediaQuery) . ';';
×
85
    }
86

87
    public function atRuleName(): string
×
88
    {
89
        return 'import';
×
90
    }
91

92
    /**
93
     * @return array<int, URL|string>
94
     */
95
    public function atRuleArgs(): array
×
96
    {
NEW
97
        $result = [$this->location];
×
98
        if ($this->mediaQuery) {
×
NEW
99
            \array_push($result, $this->mediaQuery);
×
100
        }
NEW
101
        return $result;
×
102
    }
103

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

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

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

128
    /**
129
     * @return string
130
     */
131
    public function getMediaQuery()
×
132
    {
133
        return $this->mediaQuery;
×
134
    }
135
}
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