Skip to content

Commit 0cf2cc0

Browse files
authored
Merge pull request MyIntervals#159 from sabberworm/fix-set-get-charset
Fix error with charset.
2 parents 57b42ba + 2c99470 commit 0cf2cc0

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

lib/Sabberworm/CSS/Parser.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
* Parser class parses CSS from text into a data structure.
1010
*/
1111
class Parser {
12-
private $sText;
13-
private $iLineNo;
14-
1512
private $oParserState;
1613

1714
/**
@@ -23,24 +20,21 @@ class Parser {
2320
* @param int $iLineNo
2421
*/
2522
public function __construct($sText, Settings $oParserSettings = null, $iLineNo = 1) {
26-
$this->sText = $sText;
2723
if ($oParserSettings === null) {
2824
$oParserSettings = Settings::create();
2925
}
30-
$this->oParserSettings = $oParserSettings;
31-
$this->iLineNo = $iLineNo;
26+
$this->oParserState = new ParserState($sText, $oParserSettings, $iLineNo);
3227
}
3328

3429
public function setCharset($sCharset) {
35-
$this->oParserHelper->setCharset($sCharset);
30+
$this->oParserState->setCharset($sCharset);
3631
}
3732

3833
public function getCharset() {
39-
$this->oParserHelper->getCharset();
34+
$this->oParserState->getCharset();
4035
}
4136

4237
public function parse() {
43-
$this->oParserState = new ParserState($this->sText, $this->oParserSettings);
4438
return Document::parse($this->oParserState);
4539
}
4640

0 commit comments

Comments
 (0)