Skip to content

Commit 9da96d5

Browse files
ro0NLfabpot
authored andcommitted
[Console][FrameworkBundle] Revised console header formatting
1 parent 5062304 commit 9da96d5

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

Console/Application.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ public function __construct(KernelInterface $kernel)
3939
{
4040
$this->kernel = $kernel;
4141

42-
parent::__construct('Symfony', Kernel::VERSION.' - '.$kernel->getName().'/'.$kernel->getEnvironment().($kernel->isDebug() ? '/debug' : ''));
42+
parent::__construct('Symfony', Kernel::VERSION);
4343

44-
$this->getDefinition()->addOption(new InputOption('--env', '-e', InputOption::VALUE_REQUIRED, 'The Environment name.', $kernel->getEnvironment()));
45-
$this->getDefinition()->addOption(new InputOption('--no-debug', null, InputOption::VALUE_NONE, 'Switches off debug mode.'));
44+
$this->getDefinition()->addOption(new InputOption('--env', '-e', InputOption::VALUE_REQUIRED, 'The environment name', $kernel->getEnvironment()));
45+
$this->getDefinition()->addOption(new InputOption('--no-debug', null, InputOption::VALUE_NONE, 'Switches off debug mode'));
4646
}
4747

4848
/**
@@ -100,6 +100,14 @@ public function all($namespace = null)
100100
return parent::all($namespace);
101101
}
102102

103+
/**
104+
* {@inheritdoc}
105+
*/
106+
public function getLongVersion()
107+
{
108+
return parent::getLongVersion().sprintf(' (kernel: <comment>%s</>, env: <comment>%s</>, debug: <comment>%s</>)', $this->kernel->getName(), $this->kernel->getEnvironment(), $this->kernel->isDebug() ? 'true' : 'false');
109+
}
110+
103111
protected function registerCommands()
104112
{
105113
if ($this->commandsRegistered) {

0 commit comments

Comments
 (0)