示例#1
0
 /**
  * Constructor
  *
  * @param string $string String to parse
  */
 public function __construct($string)
 {
     $this->rawString = $string;
     $parts = explode(Line::SEPARATOR, $string);
     foreach ($parts as $item) {
         $line = new Line($item);
         if ($line->isStyle()) {
             $this->styles = array_merge($this->styles, $line->getStyles());
         } elseif ($line->isDefine()) {
             $this->defines[$line->getDefineKey()] = $line->getDefineWord();
         } elseif (!$line->isEmpty()) {
             $this->lines[] = $line;
         }
     }
 }
 public function testIsEmptyForLineWithContent()
 {
     $line = new Line('$a = 5;');
     $this->assertFalse($line->isEmpty());
 }