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

MyIntervals / PHP-CSS-Parser / 13267478804

11 Feb 2025 04:17PM UTC coverage: 49.156%. Remained the same
13267478804

Pull #910

github

web-flow
Merge ed5dea74d into b3e83b867
Pull Request #910: [CLEANUP] Avoid Hungarian notation for `outputFormat`

22 of 58 new or added lines in 18 files covered. (37.93%)

1 existing line in 1 file now uncovered.

932 of 1896 relevant lines covered (49.16%)

11.42 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
     * @internal since 8.8.0
21
     */
22
    protected $aComponents;
23

24
    /**
25
     * @var string
26
     *
27
     * @internal since 8.8.0
28
     */
29
    protected $sSeparator;
30

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

46
    /**
47
     * @param Value|string $mComponent
48
     */
49
    public function addListComponent($mComponent): void
×
50
    {
51
        $this->aComponents[] = $mComponent;
×
52
    }
×
53

54
    /**
55
     * @return array<array-key, Value|string>
56
     */
57
    public function getListComponents()
×
58
    {
59
        return $this->aComponents;
×
60
    }
61

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

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

78
    /**
79
     * @param string $sSeparator
80
     */
81
    public function setListSeparator($sSeparator): void
×
82
    {
83
        $this->sSeparator = $sSeparator;
×
84
    }
×
85

86
    public function __toString(): string
×
87
    {
88
        return $this->render(new OutputFormat());
×
89
    }
90

NEW
91
    public function render(OutputFormat $outputFormat): string
×
92
    {
NEW
93
        return $outputFormat->implode(
×
NEW
94
            $outputFormat->spaceBeforeListArgumentSeparator($this->sSeparator) . $this->sSeparator
×
NEW
95
            . $outputFormat->spaceAfterListArgumentSeparator($this->sSeparator),
×
UNCOV
96
            $this->aComponents
×
97
        );
98
    }
99
}
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