PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.16
Yatra – Travel Booking & Tour Operator Software v3.0.16
3.0.16 3.0.15 3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 All 84 releases
yatra / vendor / sabberworm / php-css-parser / src / Value / LineName.php

LineName.php in Yatra – Travel Booking & Tour Operator Software 3.0.16, 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