public function __construct($token, $if = true) { parent::__construct($token); if ($if) { preg_match(self::MATCH_IF, $token->source, $matches); $this->expression = $matches[SassIfNode::IF_EXPRESSION]; } else { preg_match(self::MATCH_ELSE, $token->source, $matches); $this->expression = sizeof($matches) == 1 ? null : $matches[SassIfNode::ELSE_EXPRESSION]; } }
/** * SassElseNode constructor. * @param object source token * @return SassElseNode */ public function __construct($token) { parent::__construct($token, false); }