PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 10.2.2
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v10.2.2
11.1.1 11.1.0 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 All 62 releases
acymailing / back / Libraries / Sabberworm / CSS / src / Parser.php

Parser.php in AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress 10.2.2, at back/Libraries/Sabberworm/CSS/src/Parser.php

61 lines 1.3 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;
4
5 use Sabberworm\CSS\CSSList\Document;
6 use Sabberworm\CSS\Parsing\ParserState;
7 use Sabberworm\CSS\Parsing\SourceException;
8
9 /**
10 * This class parses CSS from text into a data structure.
11 */
12 class Parser
13 {
14 /**
15 * @var ParserState
16 */
17 private $oParserState;
18
19 /**
20 * @param string $sText
21 * @param Settings|null $oParserSettings
22 * @param int $iLineNo the line number (starting from 1, not from 0)
23 */
24 public function __construct($sText, Settings $oParserSettings = null, $iLineNo = 1)
25 {
26 if ($oParserSettings === null) {
27 $oParserSettings = Settings::create();
28 }
29 $this->oParserState = new ParserState($sText, $oParserSettings, $iLineNo);
30 }
31
32 /**
33 * @param string $sCharset
34 *
35 * @return void
36 */
37 public function setCharset($sCharset)
38 {
39 $this->oParserState->setCharset($sCharset);
40 }
41
42 /**
43 * @return void
44 */
45 public function getCharset()
46 {
47 // Note: The `return` statement is missing here. This is a bug that needs to be fixed.
48 $this->oParserState->getCharset();
49 }
50
51 /**
52 * @return Document
53 *
54 * @throws SourceException
55 */
56 public function parse()
57 {
58 return Document::parse($this->oParserState);
59 }
60 }
61