CSSList
8 months ago
Comment
3 years ago
Parsing
2 years ago
Property
2 years ago
Rule
2 years ago
RuleSet
8 months ago
Value
2 years ago
OutputFormat.php
2 years ago
OutputFormatter.php
2 years ago
Parser.php
8 months ago
Renderable.php
4 years ago
Settings.php
4 years ago
index.php
3 years ago
Parser.php
31 lines
| 1 | <?php |
| 2 | namespace MailPoetVendor\Sabberworm\CSS; |
| 3 | if (!defined('ABSPATH')) exit; |
| 4 | use MailPoetVendor\Sabberworm\CSS\CSSList\Document; |
| 5 | use MailPoetVendor\Sabberworm\CSS\Parsing\ParserState; |
| 6 | use MailPoetVendor\Sabberworm\CSS\Parsing\SourceException; |
| 7 | class Parser |
| 8 | { |
| 9 | private $oParserState; |
| 10 | public function __construct($sText,?Settings $oParserSettings = null, $iLineNo = 1) |
| 11 | { |
| 12 | if ($oParserSettings === null) { |
| 13 | $oParserSettings = Settings::create(); |
| 14 | } |
| 15 | $this->oParserState = new ParserState($sText, $oParserSettings, $iLineNo); |
| 16 | } |
| 17 | public function setCharset($sCharset) |
| 18 | { |
| 19 | $this->oParserState->setCharset($sCharset); |
| 20 | } |
| 21 | public function getCharset() |
| 22 | { |
| 23 | // Note: The `return` statement is missing here. This is a bug that needs to be fixed. |
| 24 | $this->oParserState->getCharset(); |
| 25 | } |
| 26 | public function parse() |
| 27 | { |
| 28 | return Document::parse($this->oParserState); |
| 29 | } |
| 30 | } |
| 31 |