private function parseList(CSSList $oList, $bIsRoot = false) { while (!$this->isEnd()) { if ($this->comes('@')) { $oList->append($this->parseAtRule()); } else { if ($this->comes('}')) { $this->consume('}'); if ($bIsRoot) { throw new Exception("Unopened {"); } else { return; } } else { $oList->append($this->parseSelector()); } } $this->consumeWhiteSpace(); } if (!$bIsRoot) { throw new Exception("Unexpected end of document"); } }
public function __toString() { $sResult = "@media {$this->sQuery} {"; $sResult .= parent::__toString(); $sResult .= '}'; return $sResult; }