From f35f1e1f3ca14267279fbd7923ff658eafe779e0 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 8 Feb 2011 22:36:36 +0100 Subject: [PATCH] [FrameworkBundle] fixed init:bundle command --- .../Bundle/FrameworkBundle/Command/InitBundleCommand.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/InitBundleCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/InitBundleCommand.php index deb6a1639b..500eb99eda 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/InitBundleCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/InitBundleCommand.php @@ -71,16 +71,18 @@ EOT // user specified bundle name? $bundle = $input->getArgument('bundleName'); - if ('' === $bundle) { + if (!$bundle) { $bundle = strtr($namespace, array('\\' => '')); - } elseif (!preg_match('/Bundle$/', $bundle)) { + } + + if (!preg_match('/Bundle$/', $bundle)) { throw new \InvalidArgumentException('The bundle name must end with Bundle.'); } $dir = $input->getArgument('dir'); // add trailing / if necessary - $dir = '/' === substr($dir, -1, 1) ? $dir : $dir . '/'; + $dir = '/' === substr($dir, -1, 1) ? $dir : $dir.'/'; $targetDir = $dir.strtr($namespace, '\\', '/');