$kind = self::KIND_HASHBANG;
$text =
substr($rawText, 2
);
} elseif ($start === "<!" &&
substr($rawText, 2, 2
) === "--"
) { $kind = self::KIND_HTML_OPEN;
$text =
substr($rawText, 4
);
} elseif ($start === "--" &&
substr($rawText, 2, 1
) === ">"
) { $kind = self::KIND_HTML_CLOSE;
$text =
substr($rawText, 3
);
} else { throw new \
Exception("Invalid comment"
);
} return $this->
setKind($kind)->
setText($text);
} /**
* Sets leading comments array
*
* @param Comment[] $comments Comments array
*
* @return $this
*/
public function setLeadingComments($comments) {