protected function deduplicate($lines) {
$unique = array();
$comments = array();

foreach($lines as $line) {
if (strpos($line, '/*') === 0) {
$comments[] = $line;
continue;
}
if (!in_array($line, $unique)) {
$unique[] = $line;
}
array_splice($unique, array_search($line, $unique), 0, $comments);
$comments = array();
}
return array_merge($unique, $comments);
}