PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.19
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.19
1.10.19 1.10.18 1.10.17 1.10.16 1.10.15 1.10.13 1.10.14 1.10.12 1.10.11 1.10.10 1.10.9 1.10.8 untagged-3d9b7ccddc54df87c672 1.10.7 1.10.6 1.10.5 1.10.3 1.10.4 1.10.2 1.10.1 1.10.0 1.9.17 1.9.15 1.9.16 1.9.14 All 163 releases
woocommerce-pos / vendor_prefixed / sabberworm / php-css-parser / src / Parser.php

Parser.php in WCPOS – Point of Sale (POS) plugin for WooCommerce 1.10.19, at vendor_prefixed/sabberworm/php-css-parser/src/Parser.php

39 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare (strict_types=1);
4 namespace WCPOS\Vendor\Sabberworm\CSS;
5
6 use WCPOS\Vendor\Sabberworm\CSS\CSSList\Document;
7 use WCPOS\Vendor\Sabberworm\CSS\Parsing\ParserState;
8 use WCPOS\Vendor\Sabberworm\CSS\Parsing\SourceException;
9 /**
10 * This class parses CSS from text into a data structure.
11 */
12 class Parser
13 {
14 /**
15 * @var ParserState
16 */
17 private $parserState;
18 /**
19 * @param string $text the complete CSS as text (i.e., usually the contents of a CSS file)
20 * @param int<1, max> $lineNumber the line number (starting from 1, not from 0)
21 */
22 public function __construct(string $text, ?Settings $parserSettings = null, int $lineNumber = 1)
23 {
24 if ($parserSettings === null) {
25 $parserSettings = Settings::create();
26 }
27 $this->parserState = new ParserState($text, $parserSettings, $lineNumber);
28 }
29 /**
30 * Parses the CSS provided to the constructor and creates a `Document` from it.
31 *
32 * @throws SourceException
33 */
34 public function parse() : Document
35 {
36 return Document::parse($this->parserState);
37 }
38 }
39