PluginProbe
Easy Invoice – Invoice Generator, PDF Quotes & Payments / 2.4.0
Easy Invoice – Invoice Generator, PDF Quotes & Payments v2.4.0
2.4.0 2.4.1 2.3.8 2.3.7 2.3.6 2.3.5 2.3.4 2.3.3 2.3.2 2.3.1 2.2.0 2.1.21 2.1.20 2.1.19 2.1.18 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.16 2.1.2 All 57 releases
easy-invoice / vendor / sabberworm / php-css-parser / src / Value / LineName.php

LineName.php in Easy Invoice – Invoice Generator, PDF Quotes & Payments 2.4.0, at vendor/sabberworm/php-css-parser/src/Value/LineName.php

72 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Sabberworm\CSS\Value;
4
5 use Sabberworm\CSS\OutputFormat;
6 use Sabberworm\CSS\Parsing\ParserState;
7 use Sabberworm\CSS\Parsing\UnexpectedEOFException;
8 use Sabberworm\CSS\Parsing\UnexpectedTokenException;
9
10 class LineName extends ValueList
11 {
12 /**
13 * @param array<int, RuleValueList|CSSFunction|CSSString|LineName|Size|URL|string> $aComponents
14 * @param int $iLineNo
15 */
16 public function __construct(array $aComponents = [], $iLineNo = 0)
17 {
18 parent::__construct($aComponents, ' ', $iLineNo);
19 }
20
21 /**
22 * @return LineName
23 *
24 * @throws UnexpectedTokenException
25 * @throws UnexpectedEOFException
26 *
27 * @internal since V8.8.0
28 */
29 public static function parse(ParserState $oParserState)
30 {
31 $oParserState->consume('[');
32 $oParserState->consumeWhiteSpace();
33 $aNames = [];
34 do {
35 if ($oParserState->getSettings()->bLenientParsing) {
36 try {
37 $aNames[] = $oParserState->parseIdentifier();
38 } catch (UnexpectedTokenException $e) {
39 if (!$oParserState->comes(']')) {
40 throw $e;
41 }
42 }
43 } else {
44 $aNames[] = $oParserState->parseIdentifier();
45 }
46 $oParserState->consumeWhiteSpace();
47 } while (!$oParserState->comes(']'));
48 $oParserState->consume(']');
49 return new LineName($aNames, $oParserState->currentLine());
50 }
51
52 /**
53 * @return string
54 *
55 * @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead.
56 */
57 public function __toString()
58 {
59 return $this->render(new OutputFormat());
60 }
61
62 /**
63 * @param OutputFormat|null $oOutputFormat
64 *
65 * @return string
66 */
67 public function render($oOutputFormat)
68 {
69 return '[' . parent::render(OutputFormat::createCompact()) . ']';
70 }
71 }
72