public function renderHeader(array $comments = [])
{
if ($this->isSilent()) {
return $this;
}
$this->getLogger()->debug('rendering comments');
fputs($this->file, ' "comments": [' . PHP_EOL);
foreach ($comments as $i => $text) {
fputs($this->file, ' ' . json_encode($text));
if ($i < count($comments) - 1) {
fputs($this->file, ',');
}
fputs($this->file, PHP_EOL);
}
fputs($this->file, ' ],' . PHP_EOL);
return $this;
}