Sabberworm\CSS\CSSList\CSSList::append PHP Method

append() public method

public append ( $oItem )
    public function append($oItem)
    {
        $this->aContents[] = $oItem;
    }

Usage Example

Example #1
0
 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 {
                 if ($this->oParserSettings->bLenientParsing) {
                     try {
                         $oList->append($this->parseSelector());
                     } catch (UnexpectedTokenException $e) {
                     }
                 } else {
                     $oList->append($this->parseSelector());
                 }
             }
         }
         $this->consumeWhiteSpace();
     }
     if (!$bIsRoot) {
         throw new \Exception("Unexpected end of document");
     }
 }