Ver código fonte

Merge remote branch 'symfony/master' into experimental

Bernhard Schussek 14 anos atrás
pai
commit
7006202e24

+ 0 - 6
src/Symfony/Bundle/AsseticBundle/Command/DumpCommand.php

@@ -14,8 +14,6 @@ namespace Symfony\Bundle\AsseticBundle\Command;
 use Assetic\Asset\AssetInterface;
 use Assetic\Factory\LazyAssetManager;
 use Symfony\Bundle\FrameworkBundle\Command\Command;
-use Symfony\Bundle\AsseticBundle\Event\WriteEvent;
-use Symfony\Bundle\AsseticBundle\Events;
 use Symfony\Component\Console\Input\InputArgument;
 use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Input\InputOption;
@@ -46,10 +44,6 @@ class DumpCommand extends Command
 
         $am = $this->container->get('assetic.asset_manager');
 
-        // notify an event so custom stream wrappers can be registered lazily
-        $writeEvent = new WriteEvent($basePath);
-        $this->container->get('event_dispatcher')->dispatch(Events::onAsseticWrite, $writeEvent);
-
         if ($input->getOption('watch')) {
             return $this->watch($am, $basePath, $output, $this->container->getParameter('kernel.debug'));
         }

+ 0 - 32
src/Symfony/Bundle/AsseticBundle/Event/WriteEvent.php

@@ -1,32 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony framework.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * This source file is subject to the MIT license that is bundled
- * with this source code in the file LICENSE.
- */
-
-namespace Symfony\Bundle\AsseticBundle\Event;
-
-use Symfony\Component\EventDispatcher\Event;
-
-/**
- * @author Bernhard Schussek <bernhard.schussek@symfony-project.com>
- */
-class WriteEvent extends Event
-{
-    private $targetPath;
-
-    public function __construct($targetPath = null)
-    {
-        $this->targetPath = $targetPath;
-    }
-
-    public function getTargetPath()
-    {
-        return $this->targetPath;
-    }
-}

+ 0 - 20
src/Symfony/Bundle/AsseticBundle/Events.php

@@ -1,20 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony framework.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * This source file is subject to the MIT license that is bundled
- * with this source code in the file LICENSE.
- */
-
-namespace Symfony\Bundle\AsseticBundle;
-
-/**
- * @author Bernhard Schussek <bernhard.schussek@symfony-project.com>
- */
-final class Events
-{
-    const onAsseticWrite = 'onAsseticWrite';
-}

+ 11 - 1
src/Symfony/Component/HttpKernel/HttpKernel.php

@@ -120,7 +120,13 @@ class HttpKernel implements HttpKernelInterface
             }
 
             if (!$response instanceof Response) {
-                throw new \LogicException(sprintf('The controller must return a response (%s given).', $this->varToString($response)));
+                $msg = sprintf('The controller must return a response (%s given).', $this->varToString($response));
+
+                // the user may have forgotten to return something
+                if (null === $response) {
+                    $msg .= ' Did you forget to add a return statement somewhere in your controller?';
+                }
+                throw new \LogicException($msg);
             }
         }
 
@@ -187,6 +193,10 @@ class HttpKernel implements HttpKernelInterface
             return '[resource]';
         }
 
+        if (null === $var) {
+            return 'null';
+        }
+
         return str_replace("\n", '', var_export((string) $var, true));
     }
 }

+ 1 - 1
src/Symfony/Component/HttpKernel/Util/Filesystem.php

@@ -55,7 +55,7 @@ class Filesystem
      */
     public function mkdir($dirs, $mode = 0777)
     {
-        $ret = false;
+        $ret = true;
         foreach ($this->toIterator($dirs) as $dir) {
             if (is_dir($dir)) {
                 continue;