Commit 175ebfe2 authored by Fabien Potencier's avatar Fabien Potencier

renamed $sc to $app

parent 4598fa66
...@@ -44,7 +44,7 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe ...@@ -44,7 +44,7 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
*/ */
public function __construct() public function __construct()
{ {
$sc = $this; $app = $this;
$this['autoloader'] = $this->asShared(function () { $this['autoloader'] = $this->asShared(function () {
$loader = new UniversalClassLoader(); $loader = new UniversalClassLoader();
...@@ -57,14 +57,14 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe ...@@ -57,14 +57,14 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
return new RouteCollection(); return new RouteCollection();
}); });
$this['controllers'] = $this->asShared(function () use ($sc) { $this['controllers'] = $this->asShared(function () use ($app) {
return new ControllerCollection($sc['routes']); return new ControllerCollection($app['routes']);
}); });
$this['dispatcher'] = $this->asShared(function () use ($sc) { $this['dispatcher'] = $this->asShared(function () use ($app) {
$dispatcher = new EventDispatcher(); $dispatcher = new EventDispatcher();
$dispatcher->addSubscriber($sc); $dispatcher->addSubscriber($app);
$dispatcher->addListener(HttpKernelEvents::onCoreView, $sc, -10); $dispatcher->addListener(HttpKernelEvents::onCoreView, $app, -10);
return $dispatcher; return $dispatcher;
}); });
...@@ -73,8 +73,8 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe ...@@ -73,8 +73,8 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
return new ControllerResolver(); return new ControllerResolver();
}); });
$this['kernel'] = $this->asShared(function () use ($sc) { $this['kernel'] = $this->asShared(function () use ($app) {
return new HttpKernel($sc['dispatcher'], $sc['resolver']); return new HttpKernel($app['dispatcher'], $app['resolver']);
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment