Commit 354b7663 authored by Henrik Bjørnskov's avatar Henrik Bjørnskov Committed by Fabien Potencier

Register clean up

parent 0328d904
......@@ -143,11 +143,7 @@ class Application extends Container implements HttpKernelInterface, TerminableIn
{
$this->providers[] = $provider;
$provider->register($this);
foreach ($values as $key => $value) {
$this[$key] = $value;
}
parent::register($provider, $values);
return $this;
}
......@@ -160,17 +156,19 @@ class Application extends Container implements HttpKernelInterface, TerminableIn
*/
public function boot()
{
if (!$this->booted) {
$this->booted = true;
if ($this->booted) {
return;
}
foreach ($this->providers as $provider) {
if ($provider instanceof EventListenerProviderInterface) {
$provider->subscribe($this, $this['dispatcher']);
}
$this->booted = true;
foreach ($this->providers as $provider) {
if ($provider instanceof EventListenerProviderInterface) {
$provider->subscribe($this, $this['dispatcher']);
}
if ($provider instanceof BootableProviderInterface) {
$provider->boot($this);
}
if ($provider instanceof BootableProviderInterface) {
$provider->boot($this);
}
}
}
......
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