• 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/Value/ValueList.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Sabberworm\CSS\Value;
6

7
use Sabberworm\CSS\OutputFormat;
8

9
/**
10
 * A `ValueList` represents a lists of `Value`s, separated by some separation character
11
 * (mostly `,`, whitespace, or `/`).
12
 *
13
 * There are two types of `ValueList`s: `RuleValueList` and `CSSFunction`
14
 */
15
abstract class ValueList extends Value
16
{
17
    /**
18
     * @var array<array-key, Value|string>
19
     */
20
    protected $aComponents;
21

22
    /**
23
     * @var string
24
     */
25
    protected $sSeparator;
26

27
    /**
28
     * @param array<array-key, Value|string>|Value|string $aComponents
29
     * @param string $sSeparator
30
     * @param int $lineNumber
31
     */
NEW
32
    public function __construct($aComponents = [], $sSeparator = ',', $lineNumber = 0)
×
33
    {
NEW
34
        parent::__construct($lineNumber);
×
35
        if (!\is_array($aComponents)) {
×
36
            $aComponents = [$aComponents];
×
37
        }
38
        $this->aComponents = $aComponents;
×
39
        $this->sSeparator = $sSeparator;
×
40
    }
×
41

42
    /**
43
     * @param Value|string $mComponent
44
     */
45
    public function addListComponent($mComponent): void
×
46
    {
47
        $this->aComponents[] = $mComponent;
×
48
    }
×
49

50
    /**
51
     * @return array<array-key, Value|string>
52
     */
53
    public function getListComponents()
×
54
    {
55
        return $this->aComponents;
×
56
    }
57

58
    /**
59
     * @param array<array-key, Value|string> $aComponents
60
     */
61
    public function setListComponents(array $aComponents): void
×
62
    {
63
        $this->aComponents = $aComponents;
×
64
    }
×
65

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

74
    /**
75
     * @param string $sSeparator
76
     */
77
    public function setListSeparator($sSeparator): void
×
78
    {
79
        $this->sSeparator = $sSeparator;
×
80
    }
×
81

82
    public function __toString(): string
×
83
    {
84
        return $this->render(new OutputFormat());
×
85
    }
86

87
    /**
88
     * @return string
89
     */
90
    public function render(OutputFormat $oOutputFormat)
×
91
    {
92
        return $oOutputFormat->implode(
×
93
            $oOutputFormat->spaceBeforeListArgumentSeparator($this->sSeparator) . $this->sSeparator
×
94
            . $oOutputFormat->spaceAfterListArgumentSeparator($this->sSeparator),
×
95
            $this->aComponents
×
96
        );
97
    }
98
}
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