浏览代码

[FrameworkBundle] fixed CS

Fabien Potencier 14 年之前
父节点
当前提交
0ca1d1a8cd
共有 1 个文件被更改,包括 18 次插入19 次删除
  1. 18 19
      src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php

+ 18 - 19
src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php

@@ -98,41 +98,39 @@ EOF
     protected function getTempKernel(KernelInterface $parent, $debug, $warmupDir)
     {
         $parentClass = get_class($parent);
-        
+
         $namespace = '';
-        if (($pos = strrpos($parentClass, '\\')) !== false) {
+        if (false !== $pos = strrpos($parentClass, '\\')) {
             $namespace = substr($parentClass, 0, $pos);
             $parentClass = substr($parentClass, $pos + 1);
         }
-        
+
         $rand = uniqid();
         $class = $parentClass.$rand;
         $rootDir = $parent->getRootDir();
         $code = <<<EOF
 <?php
 
-namespace $namespace 
-{
-
-class $class extends $parentClass
+namespace $namespace
 {
-    public function getCacheDir()
+    class $class extends $parentClass
     {
-        return '$warmupDir';
-    }
+        public function getCacheDir()
+        {
+            return '$warmupDir';
+        }
 
-    public function getRootDir()
-    {
-        return '$rootDir';
-    }
+        public function getRootDir()
+        {
+            return '$rootDir';
+        }
 
-    protected function getContainerClass()
-    {
-        return parent::getContainerClass().'__{$rand}__';
+        protected function getContainerClass()
+        {
+            return parent::getContainerClass().'__{$rand}__';
+        }
     }
 }
-
-}
 EOF;
         $this->container->get('filesystem')->mkdirs($warmupDir);
         file_put_contents($file = $warmupDir.'/kernel.tmp', $code);
@@ -140,6 +138,7 @@ EOF;
         @unlink($file);
 
         $class = "\\$namespace\\$class"; 
+
         return new $class($parent->getEnvironment(), $debug);
     }
 }