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 4cb45fe

Browse filesBrowse files
feature #39851 [Console] enable describing commands in ways that make the list command lazy (nicolas-grekas)
This PR was merged into the 5.3-dev branch. Discussion ---------- [Console] enable describing commands in ways that make the `list` command lazy | Q | A | ------------- | --- | Branch? | 5.x | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | Fix #33804 | License | MIT | Doc PR | - This PR improves the way one can describe a command so that the `list` command can be made lazy: - when provided using the `$defaultName` property or the `console.command` tag, the name of a command is now exploded using the `|` character. The first name in the list defines the name of the command, the other ones its aliases. When the first name is the empty string, the second name is used instead, and the command is declared as hidden. - a new `$defaultDescription` static property and a new `description` tag attribute allow for defining the commands' description while registering them. Together, this is enough to make the `list` command lazy, because this command only accesses each command's name, aliases, hidden-status, and description. On the implementation side, this PR adds a `LazyCommand` class that proxies regular commands to make them lazy for the target purpose. This PR will enable support for attributes for configuring a command name+description+etc. e.g. using the concepts in #39804: `#[CommandAutoTag(name: 'foo:bar', desc: 'boo', hidden: true)]#` The attribute could very well split the `hidden` and `aliases` settings apart - while the underlying code and pre-PHP8 apps would use the compact form, because dealing with many static properties + methods would be a maintenance pain imho. Commits ------- 8a1a1b8 [Console] enable describing commands in ways that make the `list` command lazy
2 parents 4818b28 + 8a1a1b8 commit 4cb45fe
Copy full SHA for 4cb45fe

File tree

51 files changed

+463
-90
lines changed
Filter options

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner

51 files changed

+463
-90
lines changed

‎src/Symfony/Bridge/Monolog/Command/ServerLogCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Monolog/Command/ServerLogCommand.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class ServerLogCommand extends Command
3434
private $handler;
3535

3636
protected static $defaultName = 'server:log';
37+
protected static $defaultDescription = 'Starts a log server that displays logs in real time';
3738

3839
public function isEnabled()
3940
{
@@ -60,7 +61,7 @@ protected function configure()
6061
->addOption('format', null, InputOption::VALUE_REQUIRED, 'The line format', ConsoleFormatter::SIMPLE_FORMAT)
6162
->addOption('date-format', null, InputOption::VALUE_REQUIRED, 'The date format', ConsoleFormatter::SIMPLE_DATE)
6263
->addOption('filter', null, InputOption::VALUE_REQUIRED, 'An expression to filter log. Example: "level > 200 or channel in [\'app\', \'doctrine\']"')
63-
->setDescription('Starts a log server that displays logs in real time')
64+
->setDescription(self::$defaultDescription)
6465
->setHelp(<<<'EOF'
6566
<info>%command.name%</info> starts a log server to display in real time the log
6667
messages generated by your application:

‎src/Symfony/Bridge/Twig/Command/DebugCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/Command/DebugCommand.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
class DebugCommand extends Command
3434
{
3535
protected static $defaultName = 'debug:twig';
36+
protected static $defaultDescription = 'Shows a list of twig functions, filters, globals and tests';
3637

3738
private $twig;
3839
private $projectDir;
@@ -60,7 +61,7 @@ protected function configure()
6061
new InputOption('filter', null, InputOption::VALUE_REQUIRED, 'Show details for all entries matching this filter'),
6162
new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (text or json)', 'text'),
6263
])
63-
->setDescription('Shows a list of twig functions, filters, globals and tests')
64+
->setDescription(self::$defaultDescription)
6465
->setHelp(<<<'EOF'
6566
The <info>%command.name%</info> command outputs a list of twig functions,
6667
filters, globals and tests.

‎src/Symfony/Bridge/Twig/Command/LintCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/Command/LintCommand.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
class LintCommand extends Command
3636
{
3737
protected static $defaultName = 'lint:twig';
38+
protected static $defaultDescription = 'Lints a template and outputs encountered errors';
3839

3940
private $twig;
4041

@@ -48,7 +49,7 @@ public function __construct(Environment $twig)
4849
protected function configure()
4950
{
5051
$this
51-
->setDescription('Lints a template and outputs encountered errors')
52+
->setDescription(self::$defaultDescription)
5253
->addOption('format', null, InputOption::VALUE_REQUIRED, 'The output format', 'txt')
5354
->addOption('show-deprecations', null, InputOption::VALUE_NONE, 'Show deprecations as errors')
5455
->addArgument('filename', InputArgument::IS_ARRAY, 'A file, a directory or "-" for reading from STDIN')

‎src/Symfony/Bundle/DebugBundle/Resources/config/services.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/DebugBundle/Resources/config/services.php
+7-2Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

1212
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
1313

14+
use Monolog\Formatter\FormatterInterface;
1415
use Symfony\Bridge\Monolog\Command\ServerLogCommand;
16+
use Symfony\Bridge\Monolog\Formatter\ConsoleFormatter;
1517
use Symfony\Bridge\Twig\Extension\DumpExtension;
1618
use Symfony\Component\HttpKernel\DataCollector\DumpDataCollector;
1719
use Symfony\Component\HttpKernel\EventListener\DumpListener;
@@ -127,9 +129,12 @@
127129
'html' => inline_service(HtmlDescriptor::class)->args([service('var_dumper.html_dumper')]),
128130
],
129131
])
130-
->tag('console.command', ['command' => 'server:dump'])
132+
->tag('console.command')
131133

132134
->set('monolog.command.server_log', ServerLogCommand::class)
133-
->tag('console.command', ['command' => 'server:log'])
134135
;
136+
137+
if (class_exists(ConsoleFormatter::class) && interface_exists(FormatterInterface::class)) {
138+
$container->services()->get('monolog.command.server_log')->tag('console.command');
139+
}
135140
};

‎src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,15 @@
3030
class AboutCommand extends Command
3131
{
3232
protected static $defaultName = 'about';
33+
protected static $defaultDescription = 'Displays information about the current project';
3334

3435
/**
3536
* {@inheritdoc}
3637
*/
3738
protected function configure()
3839
{
3940
$this
40-
->setDescription('Displays information about the current project')
41+
->setDescription(self::$defaultDescription)
4142
->setHelp(<<<'EOT'
4243
The <info>%command.name%</info> command displays information about the current Symfony project.
4344

‎src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class AssetsInstallCommand extends Command
4040
public const METHOD_RELATIVE_SYMLINK = 'relative symlink';
4141

4242
protected static $defaultName = 'assets:install';
43+
protected static $defaultDescription = 'Installs bundles web assets under a public directory';
4344

4445
private $filesystem;
4546
private $projectDir;
@@ -64,7 +65,7 @@ protected function configure()
6465
->addOption('symlink', null, InputOption::VALUE_NONE, 'Symlinks the assets instead of copying it')
6566
->addOption('relative', null, InputOption::VALUE_NONE, 'Make relative symlinks')
6667
->addOption('no-cleanup', null, InputOption::VALUE_NONE, 'Do not remove the assets of the bundles that no longer exist')
67-
->setDescription('Installs bundles web assets under a public directory')
68+
->setDescription(self::$defaultDescription)
6869
->setHelp(<<<'EOT'
6970
The <info>%command.name%</info> command installs bundle assets into a given
7071
directory (e.g. the <comment>public</comment> directory).

‎src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
class CacheClearCommand extends Command
3737
{
3838
protected static $defaultName = 'cache:clear';
39+
protected static $defaultDescription = 'Clears the cache';
3940

4041
private $cacheClearer;
4142
private $filesystem;
@@ -58,7 +59,7 @@ protected function configure()
5859
new InputOption('no-warmup', '', InputOption::VALUE_NONE, 'Do not warm up the cache'),
5960
new InputOption('no-optional-warmers', '', InputOption::VALUE_NONE, 'Skip optional cache warmers (faster)'),
6061
])
61-
->setDescription('Clears the cache')
62+
->setDescription(self::$defaultDescription)
6263
->setHelp(<<<'EOF'
6364
The <info>%command.name%</info> command clears the application cache for a given environment
6465
and debug mode:

‎src/Symfony/Bundle/FrameworkBundle/Command/CachePoolClearCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/CachePoolClearCommand.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
final class CachePoolClearCommand extends Command
2929
{
3030
protected static $defaultName = 'cache:pool:clear';
31+
protected static $defaultDescription = 'Clears cache pools';
3132

3233
private $poolClearer;
3334

@@ -47,7 +48,7 @@ protected function configure()
4748
->setDefinition([
4849
new InputArgument('pools', InputArgument::IS_ARRAY | InputArgument::REQUIRED, 'A list of cache pools or cache pool clearers'),
4950
])
50-
->setDescription('Clears cache pools')
51+
->setDescription(self::$defaultDescription)
5152
->setHelp(<<<'EOF'
5253
The <info>%command.name%</info> command clears the given cache pools or cache pool clearers.
5354

‎src/Symfony/Bundle/FrameworkBundle/Command/CachePoolDeleteCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/CachePoolDeleteCommand.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
final class CachePoolDeleteCommand extends Command
2727
{
2828
protected static $defaultName = 'cache:pool:delete';
29+
protected static $defaultDescription = 'Deletes an item from a cache pool';
2930

3031
private $poolClearer;
3132

@@ -46,7 +47,7 @@ protected function configure()
4647
new InputArgument('pool', InputArgument::REQUIRED, 'The cache pool from which to delete an item'),
4748
new InputArgument('key', InputArgument::REQUIRED, 'The cache key to delete from the pool'),
4849
])
49-
->setDescription('Deletes an item from a cache pool')
50+
->setDescription(self::$defaultDescription)
5051
->setHelp(<<<'EOF'
5152
The <info>%command.name%</info> deletes an item from a given cache pool.
5253

‎src/Symfony/Bundle/FrameworkBundle/Command/CachePoolListCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/CachePoolListCommand.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
final class CachePoolListCommand extends Command
2525
{
2626
protected static $defaultName = 'cache:pool:list';
27+
protected static $defaultDescription = 'List available cache pools';
2728

2829
private $poolNames;
2930

@@ -40,7 +41,7 @@ public function __construct(array $poolNames)
4041
protected function configure()
4142
{
4243
$this
43-
->setDescription('List available cache pools')
44+
->setDescription(self::$defaultDescription)
4445
->setHelp(<<<'EOF'
4546
The <info>%command.name%</info> command lists all available cache pools.
4647
EOF

‎src/Symfony/Bundle/FrameworkBundle/Command/CachePoolPruneCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/CachePoolPruneCommand.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
final class CachePoolPruneCommand extends Command
2626
{
2727
protected static $defaultName = 'cache:pool:prune';
28+
protected static $defaultDescription = 'Prunes cache pools';
2829

2930
private $pools;
3031

@@ -44,7 +45,7 @@ public function __construct(iterable $pools)
4445
protected function configure()
4546
{
4647
$this
47-
->setDescription('Prunes cache pools')
48+
->setDescription(self::$defaultDescription)
4849
->setHelp(<<<'EOF'
4950
The <info>%command.name%</info> command deletes all expired items from all pruneable pools.
5051

‎src/Symfony/Bundle/FrameworkBundle/Command/CacheWarmupCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/CacheWarmupCommand.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
class CacheWarmupCommand extends Command
3030
{
3131
protected static $defaultName = 'cache:warmup';
32+
protected static $defaultDescription = 'Warms up an empty cache';
3233

3334
private $cacheWarmer;
3435

@@ -48,7 +49,7 @@ protected function configure()
4849
->setDefinition([
4950
new InputOption('no-optional-warmers', '', InputOption::VALUE_NONE, 'Skip optional cache warmers (faster)'),
5051
])
51-
->setDescription('Warms up an empty cache')
52+
->setDescription(self::$defaultDescription)
5253
->setHelp(<<<'EOF'
5354
The <info>%command.name%</info> command warms up the cache.
5455

‎src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
class ConfigDebugCommand extends AbstractConfigCommand
3434
{
3535
protected static $defaultName = 'debug:config';
36+
protected static $defaultDescription = 'Dumps the current configuration for an extension';
3637

3738
/**
3839
* {@inheritdoc}
@@ -44,7 +45,7 @@ protected function configure()
4445
new InputArgument('name', InputArgument::OPTIONAL, 'The bundle name or the extension alias'),
4546
new InputArgument('path', InputArgument::OPTIONAL, 'The configuration option path'),
4647
])
47-
->setDescription('Dumps the current configuration for an extension')
48+
->setDescription(self::$defaultDescription)
4849
->setHelp(<<<'EOF'
4950
The <info>%command.name%</info> command dumps the current configuration for an
5051
extension/bundle.

‎src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
class ConfigDumpReferenceCommand extends AbstractConfigCommand
3737
{
3838
protected static $defaultName = 'config:dump-reference';
39+
protected static $defaultDescription = 'Dumps the default configuration for an extension';
3940

4041
/**
4142
* {@inheritdoc}
@@ -48,7 +49,7 @@ protected function configure()
4849
new InputArgument('path', InputArgument::OPTIONAL, 'The configuration option path'),
4950
new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (yaml or xml)', 'yaml'),
5051
])
51-
->setDescription('Dumps the default configuration for an extension')
52+
->setDescription(self::$defaultDescription)
5253
->setHelp(<<<'EOF'
5354
The <info>%command.name%</info> command dumps the default configuration for an
5455
extension/bundle.

‎src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class ContainerDebugCommand extends Command
3535
use BuildDebugContainerTrait;
3636

3737
protected static $defaultName = 'debug:container';
38+
protected static $defaultDescription = 'Displays current services for an application';
3839

3940
/**
4041
* {@inheritdoc}
@@ -57,7 +58,7 @@ protected function configure()
5758
new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw description'),
5859
new InputOption('deprecations', null, InputOption::VALUE_NONE, 'Displays deprecations generated when compiling and warming up the container'),
5960
])
60-
->setDescription('Displays current services for an application')
61+
->setDescription(self::$defaultDescription)
6162
->setHelp(<<<'EOF'
6263
The <info>%command.name%</info> command displays all configured <comment>public</comment> services:
6364

‎src/Symfony/Bundle/FrameworkBundle/Command/ContainerLintCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/ContainerLintCommand.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
final class ContainerLintCommand extends Command
3131
{
3232
protected static $defaultName = 'lint:container';
33+
protected static $defaultDescription = 'Ensures that arguments injected into services match type declarations';
3334

3435
/**
3536
* @var ContainerBuilder
@@ -42,7 +43,7 @@ final class ContainerLintCommand extends Command
4243
protected function configure()
4344
{
4445
$this
45-
->setDescription('Ensures that arguments injected into services match type declarations')
46+
->setDescription(self::$defaultDescription)
4647
->setHelp('This command parses service definitions and ensures that injected values match the type declarations of each services\' class.')
4748
;
4849
}

‎src/Symfony/Bundle/FrameworkBundle/Command/DebugAutowiringCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/DebugAutowiringCommand.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
class DebugAutowiringCommand extends ContainerDebugCommand
3131
{
3232
protected static $defaultName = 'debug:autowiring';
33+
protected static $defaultDescription = 'Lists classes/interfaces you can use for autowiring';
3334
private $supportsHref;
3435
private $fileLinkFormatter;
3536

@@ -50,7 +51,7 @@ protected function configure()
5051
new InputArgument('search', InputArgument::OPTIONAL, 'A search filter'),
5152
new InputOption('all', null, InputOption::VALUE_NONE, 'Show also services that are not aliased'),
5253
])
53-
->setDescription('Lists classes/interfaces you can use for autowiring')
54+
->setDescription(self::$defaultDescription)
5455
->setHelp(<<<'EOF'
5556
The <info>%command.name%</info> command displays the classes and interfaces that
5657
you can use as type-hints for autowiring:

‎src/Symfony/Bundle/FrameworkBundle/Command/EventDispatcherDebugCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/EventDispatcherDebugCommand.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class EventDispatcherDebugCommand extends Command
3333
private const DEFAULT_DISPATCHER = 'event_dispatcher';
3434

3535
protected static $defaultName = 'debug:event-dispatcher';
36+
protected static $defaultDescription = 'Displays configured listeners for an application';
3637
private $dispatchers;
3738

3839
public function __construct(ContainerInterface $dispatchers)
@@ -54,7 +55,7 @@ protected function configure()
5455
new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'),
5556
new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw description'),
5657
])
57-
->setDescription('Displays configured listeners for an application')
58+
->setDescription(self::$defaultDescription)
5859
->setHelp(<<<'EOF'
5960
The <info>%command.name%</info> command displays all configured listeners:
6061

‎src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class RouterDebugCommand extends Command
3636
use BuildDebugContainerTrait;
3737

3838
protected static $defaultName = 'debug:router';
39+
protected static $defaultDescription = 'Displays current routes for an application';
3940
private $router;
4041
private $fileLinkFormatter;
4142

@@ -59,7 +60,7 @@ protected function configure()
5960
new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'),
6061
new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw route(s)'),
6162
])
62-
->setDescription('Displays current routes for an application')
63+
->setDescription(self::$defaultDescription)
6364
->setHelp(<<<'EOF'
6465
The <info>%command.name%</info> displays the configured routes:
6566

‎src/Symfony/Bundle/FrameworkBundle/Command/RouterMatchCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/RouterMatchCommand.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
class RouterMatchCommand extends Command
3232
{
3333
protected static $defaultName = 'router:match';
34+
protected static $defaultDescription = 'Helps debug routes by simulating a path info match';
3435

3536
private $router;
3637
private $expressionLanguageProviders;
@@ -55,7 +56,7 @@ protected function configure()
5556
new InputOption('scheme', null, InputOption::VALUE_REQUIRED, 'Sets the URI scheme (usually http or https)'),
5657
new InputOption('host', null, InputOption::VALUE_REQUIRED, 'Sets the URI host'),
5758
])
58-
->setDescription('Helps debug routes by simulating a path info match')
59+
->setDescription(self::$defaultDescription)
5960
->setHelp(<<<'EOF'
6061
The <info>%command.name%</info> shows which routes match a given request and which don't and for what reason:
6162

‎src/Symfony/Bundle/FrameworkBundle/Command/SecretsDecryptToLocalCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/SecretsDecryptToLocalCommand.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
final class SecretsDecryptToLocalCommand extends Command
2828
{
2929
protected static $defaultName = 'secrets:decrypt-to-local';
30+
protected static $defaultDescription = 'Decrypts all secrets and stores them in the local vault';
3031

3132
private $vault;
3233
private $localVault;
@@ -42,7 +43,7 @@ public function __construct(AbstractVault $vault, AbstractVault $localVault = nu
4243
protected function configure()
4344
{
4445
$this
45-
->setDescription('Decrypts all secrets and stores them in the local vault')
46+
->setDescription(self::$defaultDescription)
4647
->addOption('force', 'f', InputOption::VALUE_NONE, 'Forces overriding of secrets that already exist in the local vault')
4748
->setHelp(<<<'EOF'
4849
The <info>%command.name%</info> command decrypts all secrets and copies them in the local vault.

‎src/Symfony/Bundle/FrameworkBundle/Command/SecretsEncryptFromLocalCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/SecretsEncryptFromLocalCommand.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
final class SecretsEncryptFromLocalCommand extends Command
2727
{
2828
protected static $defaultName = 'secrets:encrypt-from-local';
29+
protected static $defaultDescription = 'Encrypts all local secrets to the vault';
2930

3031
private $vault;
3132
private $localVault;
@@ -41,7 +42,7 @@ public function __construct(AbstractVault $vault, AbstractVault $localVault = nu
4142
protected function configure()
4243
{
4344
$this
44-
->setDescription('Encrypts all local secrets to the vault')
45+
->setDescription(self::$defaultDescription)
4546
->setHelp(<<<'EOF'
4647
The <info>%command.name%</info> command encrypts all locally overridden secrets to the vault.
4748

‎src/Symfony/Bundle/FrameworkBundle/Command/SecretsGenerateKeysCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/SecretsGenerateKeysCommand.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
final class SecretsGenerateKeysCommand extends Command
3030
{
3131
protected static $defaultName = 'secrets:generate-keys';
32+
protected static $defaultDescription = 'Generates new encryption keys';
3233

3334
private $vault;
3435
private $localVault;
@@ -44,7 +45,7 @@ public function __construct(AbstractVault $vault, AbstractVault $localVault = nu
4445
protected function configure()
4546
{
4647
$this
47-
->setDescription('Generates new encryption keys')
48+
->setDescription(self::$defaultDescription)
4849
->addOption('local', 'l', InputOption::VALUE_NONE, 'Updates the local vault.')
4950
->addOption('rotate', 'r', InputOption::VALUE_NONE, 'Re-encrypts existing secrets with the newly generated keys.')
5051
->setHelp(<<<'EOF'

0 commit comments

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