From 3af6f656a71dc8e53beed53981aee62df65aef3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Gomez?= Date: Sat, 19 Apr 2014 05:06:13 +0100 Subject: [PATCH] An error is raised if no valid bundle name is given to the FormGenerate command --- Command/FormGenerateCommand.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Command/FormGenerateCommand.php b/Command/FormGenerateCommand.php index e37b723..b3126c3 100644 --- a/Command/FormGenerateCommand.php +++ b/Command/FormGenerateCommand.php @@ -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(<<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))) {