Skip to content

Commit e1afb01

Browse files
committed
[Console] Added Application::reset()
1 parent 6811aaa commit e1afb01

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,16 @@ public function getKernel()
5555
return $this->kernel;
5656
}
5757

58+
/**
59+
* {@inheritdoc}
60+
*/
61+
public function reset()
62+
{
63+
if ($this->kernel->getContainer()->has('services_resetter')) {
64+
$this->kernel->getContainer()->get('services_resetter')->reset();
65+
}
66+
}
67+
5868
/**
5969
* Runs the current application.
6070
*

src/Symfony/Component/Console/Application.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
use Symfony\Component\ErrorCatcher\Exception\FatalThrowableError;
4646
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
4747
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
48+
use Symfony\Contracts\Service\ResetInterface;
4849

4950
/**
5051
* An Application is the container for a collection of commands.
@@ -61,7 +62,7 @@
6162
*
6263
* @author Fabien Potencier <fabien@symfony.com>
6364
*/
64-
class Application
65+
class Application implements ResetInterface
6566
{
6667
private $commands = [];
6768
private $wantHelps = false;
@@ -276,6 +277,13 @@ public function doRun(InputInterface $input, OutputInterface $output)
276277
return $exitCode;
277278
}
278279

280+
/**
281+
* {@inheritdoc}
282+
*/
283+
public function reset()
284+
{
285+
}
286+
279287
public function setHelperSet(HelperSet $helperSet)
280288
{
281289
$this->helperSet = $helperSet;

src/Symfony/Component/Console/CHANGELOG.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
4.4.0
5+
-----
6+
7+
* `Application` implements `ResetInterface`
8+
49
4.3.0
510
-----
611

@@ -32,7 +37,7 @@ CHANGELOG
3237

3338
* `OutputFormatter` throws an exception when unknown options are used
3439
* removed `QuestionHelper::setInputStream()/getInputStream()`
35-
* removed `Application::getTerminalWidth()/getTerminalHeight()` and
40+
* removed `Application::getTerminalWidth()/getTerminalHeight()` and
3641
`Application::setTerminalDimensions()/getTerminalDimensions()`
3742
* removed `ConsoleExceptionEvent`
3843
* removed `ConsoleEvents::EXCEPTION`
@@ -58,7 +63,7 @@ CHANGELOG
5863
with value optional explicitly passed empty
5964
* added console.error event to catch exceptions thrown by other listeners
6065
* deprecated console.exception event in favor of console.error
61-
* added ability to handle `CommandNotFoundException` through the
66+
* added ability to handle `CommandNotFoundException` through the
6267
`console.error` event
6368
* deprecated default validation in `SymfonyQuestionHelper::ask`
6469

@@ -74,7 +79,7 @@ CHANGELOG
7479
-----
7580

7681
* added truncate method to FormatterHelper
77-
* added setColumnWidth(s) method to Table
82+
* added setColumnWidth(s) method to Table
7883

7984
2.8.3
8085
-----

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy