소스 검색

[FrameworkBundle] fixed init:bundle command

Fabien Potencier 14 년 전
부모
커밋
f35f1e1f3c
1개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 5 3
      src/Symfony/Bundle/FrameworkBundle/Command/InitBundleCommand.php

+ 5 - 3
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, '\\', '/');