Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 97e15fe

Browse filesBrowse files
author
Robin Chalas
committed
[FrameworkBundle] Stop calling Kernel::boot() twice in cli
1 parent 7b03bff commit 97e15fe
Copy full SHA for 97e15fe

File tree

2 files changed

+4
-4
lines changed
Filter options

2 files changed

+4
-4
lines changed

‎src/Symfony/Bundle/FrameworkBundle/Console/Application.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Console/Application.php
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,14 @@ public function getKernel()
6262
*/
6363
public function doRun(InputInterface $input, OutputInterface $output)
6464
{
65-
$this->kernel->boot();
66-
67-
$this->setDispatcher($this->kernel->getContainer()->get('event_dispatcher'));
68-
6965
$this->registerCommands();
7066

7167
if ($this->registrationErrors) {
7268
$this->renderRegistrationErrors($input, $output);
7369
}
7470

71+
$this->setDispatcher($this->kernel->getContainer()->get('event_dispatcher'));
72+
7573
return parent::doRun($input, $output);
7674
}
7775

‎src/Symfony/Bundle/FrameworkBundle/Tests/Console/ApplicationTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Console/ApplicationTest.php
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ public function testRunOnlyWarnsOnUnregistrableCommandAtTheEnd()
204204
$container->setParameter('console.command.ids', array(ThrowingCommand::class => ThrowingCommand::class));
205205

206206
$kernel = $this->getMockBuilder(KernelInterface::class)->getMock();
207+
$kernel->expects($this->once())->method('boot');
207208
$kernel
208209
->method('getBundles')
209210
->willReturn(array($this->createBundleMock(
@@ -256,6 +257,7 @@ private function getKernel(array $bundles, $useDispatcher = false)
256257
;
257258

258259
$kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\KernelInterface')->getMock();
260+
$kernel->expects($this->once())->method('boot');
259261
$kernel
260262
->expects($this->any())
261263
->method('getBundles')

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.