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

MyIntervals / PHP-CSS-Parser / 13955519945

19 Mar 2025 07:54PM UTC coverage: 51.499%. Remained the same
13955519945

Pull #1197

github

web-flow
Merge 0b6cca91e into 45cd62ff0
Pull Request #1197: [TASK] Add native type declarations for `CSSFunction`

0 of 5 new or added lines in 2 files covered. (0.0%)

1 existing line in 1 file now uncovered.

945 of 1835 relevant lines covered (51.5%)

6.71 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Value/LineName.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Sabberworm\CSS\Value;
6

7
use Sabberworm\CSS\OutputFormat;
8
use Sabberworm\CSS\Parsing\ParserState;
9
use Sabberworm\CSS\Parsing\UnexpectedEOFException;
10
use Sabberworm\CSS\Parsing\UnexpectedTokenException;
11

12
class LineName extends ValueList
13
{
14
    /**
15
     * @param array<int, Value|string> $components
16
     * @param int<0, max> $lineNumber
17
     */
18
    public function __construct(array $components = [], int $lineNumber = 0)
×
19
    {
20
        parent::__construct($components, ' ', $lineNumber);
×
21
    }
×
22

23
    /**
24
     * @throws UnexpectedTokenException
25
     * @throws UnexpectedEOFException
26
     *
27
     * @internal since V8.8.0
28
     */
29
    public static function parse(ParserState $parserState): LineName
×
30
    {
31
        $parserState->consume('[');
×
32
        $parserState->consumeWhiteSpace();
×
33
        $names = [];
×
34
        do {
35
            if ($parserState->getSettings()->usesLenientParsing()) {
×
36
                try {
37
                    $names[] = $parserState->parseIdentifier();
×
38
                } catch (UnexpectedTokenException $e) {
×
39
                    if (!$parserState->comes(']')) {
×
40
                        throw $e;
×
41
                    }
42
                }
43
            } else {
44
                $names[] = $parserState->parseIdentifier();
×
45
            }
46
            $parserState->consumeWhiteSpace();
×
47
        } while (!$parserState->comes(']'));
×
48
        $parserState->consume(']');
×
49
        return new LineName($names, $parserState->currentLine());
×
50
    }
51

52
    public function render(OutputFormat $outputFormat): string
×
53
    {
54
        return '[' . parent::render(OutputFormat::createCompact()) . ']';
×
55
    }
56
}
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