public function render()
{
if (null === $this->parameters) {
throw new \RuntimeException('Template has not been bound');
}
$questionaryHeaders = ['Q', 'A'];
$output = new BufferedOutput();
$table = new TableHelper();
$table->addRow($questionaryHeaders);
$table->addRow(array_fill(0, count($questionaryHeaders), '---'));
$table->setLayout(TableHelper::LAYOUT_GITHUB);
$description = $this->parameters['description'];
unset($this->parameters['description']);
$requirements = $this->getRequirements();
foreach ($this->parameters as $key => $value) {
$label = $requirements[$key][0];
if (1 < count($choices = explode('|', $value))) {
$value = $choices[0];
}
$table->addRow([$label, $value]);
}
$table->render($output);
$out = [];
$out[] = $output->fetch();
$out[] = $description;
return implode(PHP_EOL, $out);
}