Merge pull request #46 from willdurand/no-sandbox-cmd

Add new option to the command line: --no-sandbox
This commit is contained in:
Jordi Boggiano 2012-07-18 07:50:22 -07:00
commit 8f3327b376

View File

@ -32,6 +32,7 @@ class DumpCommand extends ContainerAwareCommand
'Output format like: ' . implode(', ', $this->availableFormats), 'Output format like: ' . implode(', ', $this->availableFormats),
$this->availableFormats[0] $this->availableFormats[0]
) )
->addOption('no-sandbox', '', InputOption::VALUE_NONE)
->setName('api:doc:dump') ->setName('api:doc:dump')
; ;
} }
@ -51,6 +52,10 @@ class DumpCommand extends ContainerAwareCommand
$formatter = $this->getContainer()->get(sprintf('nelmio_api_doc.formatter.%s_formatter', $format)); $formatter = $this->getContainer()->get(sprintf('nelmio_api_doc.formatter.%s_formatter', $format));
} }
if ($input->hasOption('no-sandbox') && 'html' === $format) {
$formatter->setEnableSandbox(false);
}
$extractedDoc = $this->getContainer()->get('nelmio_api_doc.extractor.api_doc_extractor')->all(); $extractedDoc = $this->getContainer()->get('nelmio_api_doc.extractor.api_doc_extractor')->all();
$formattedDoc = $formatter->format($extractedDoc); $formattedDoc = $formatter->format($extractedDoc);