An error is raised if no valid bundle name is given to the FormGenerate command
This commit is contained in:
parent
4b5da9363e
commit
3af6f656a7
1 changed files with 5 additions and 1 deletions
|
|
@ -43,7 +43,7 @@ class FormGenerateCommand extends AbstractCommand
|
|||
|
||||
->addOption('force', 'f', InputOption::VALUE_NONE, 'Overwrite existing Form types')
|
||||
->addOption('platform', null, InputOption::VALUE_REQUIRED, 'The platform', BaseCommand::DEFAULT_PLATFORM)
|
||||
->addArgument('bundle', InputArgument::REQUIRED, 'The bundle to use to generate Form types')
|
||||
->addArgument('bundle', InputArgument::REQUIRED, 'The bundle to use to generate Form types (Ex: @AcmeDemoBundle)')
|
||||
->addArgument('models', InputArgument::IS_ARRAY, 'Model classes to generate Form Types from')
|
||||
|
||||
->setHelp(<<<EOT
|
||||
|
|
@ -65,6 +65,10 @@ EOT
|
|||
$models = $input->getArgument('models');
|
||||
$force = $input->getOption('force');
|
||||
|
||||
if (!$this->bundle) {
|
||||
throw new \InvalidArgumentException('No valid bundle given');
|
||||
}
|
||||
|
||||
$this->setupBuildTimeFiles();
|
||||
|
||||
if (!($schemas = $this->getFinalSchemas($kernel, $this->bundle))) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue