8000 Make console commands lazy · Sylius/Sylius@91c9918 · GitHub
[go: up one dir, main page]

Skip to content

Commit 91c9918

Browse files
committed
Make console commands lazy
1 parent f509b71 commit 91c9918

14 files changed

+28
-14
lines changed

src/Sylius/Bundle/AdminApiBundle/Command/CreateClientCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ final class CreateClientCommand extends ContainerAwareCommand
2828
/** @var ClientManagerInterface|null */
2929
private $clientManager;
3030

31+
protected static $defaultName = 'sylius:oauth-server:create-client';
32+
3133
public function __construct(?string $name = null, ClientManagerInterface $clientManager = null)
3234
{
3335
parent::__construct($name);
@@ -38,7 +40,6 @@ public function __construct(?string $name = null, ClientManagerInterface $client
3840
protected function configure(): void
3941
{
4042
$this
41-
->setName('sylius:oauth-server:create-client')
4243
->setDescription('Creates a new client')
4344
->addOption(
4445
'redirect-uri',

src/Sylius/Bundle/CoreBundle/Command/CancelUnpaidOrdersCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@
2222
*/
2323
class CancelUnpaidOrdersCommand extends ContainerAwareCommand
2424
{
25+
protected static $defaultName = 'sylius:cancel-unpaid-orders';
26+
2527
protected function configure(): void
2628
{
2729
$this
28-
->setName('sylius:cancel-unpaid-orders')
2930
->setDescription(
3031
'Removes order that have been unpaid for a configured period. Configuration parameter - sylius_order.order_expiration_period.'
3132
);

src/Sylius/Bundle/CoreBundle/Command/CheckRequirementsCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@
1919

2020
final class CheckRequirementsCommand extends AbstractInstallCommand
2121
{
22+
protected static $defaultName = 'sylius:install:check-requirements';
23+
2224
protected function configure(): void
2325
{
2426
$this
25-
->setName('sylius:install:check-requirements')
2627
->setDescription('Checks if all Sylius requirements are satisfied.')
2728
->setHelp(<<<EOT
2829
The <info>%command.name%</info> command checks system requirements.

src/Sylius/Bundle/CoreBundle/Command/InformAboutGUSCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@
2020

2121
final class InformAboutGUSCommand extends Command
2222
{
23+
protected static $defaultName = 'sylius:inform-about-gus';
24+
2325
protected function configure(): void
2426
{
25-
$this->setName('sylius:inform-about-gus');
2627
$this->setDescription('Informs about Sylius internal statistical service');
2728
}
2829

src/Sylius/Bundle/CoreBundle/Command/InstallAssetsCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@
1818

1919
final class InstallAssetsCommand extends AbstractInstallCommand
2020
{
21+
protected static $defaultName = 'sylius:install:assets';
22+
2123
protected function configure(): void
2224
{
2325
$this
24-
->setName('sylius:install:assets')
2526
->setDescription('Installs all Sylius assets.')
2627
->setHelp(<<<EOT
2728
The <info>%command.name%</info> command downloads and installs all Sylius media assets.

src/Sylius/Bundle/CoreBundle/Command/InstallCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222
final class InstallCommand extends AbstractInstallCommand
2323
{
24+
protected static $defaultName = 'sylius:install';
25+
2426
/**
2527
* @var array
2628
*
@@ -48,7 +50,6 @@ final class InstallCommand extends AbstractInstallCommand
4850
protected function configure(): void
4951
{
5052
$this
51-
->setName('sylius:install')
5253
->setDescription('Installs Sylius in your preferred environment.')
5354
->setHelp(<<<EOT
5455
The <info>%command.name%</info> command installs Sylius.

src/Sylius/Bundle/CoreBundle/Command/InstallDatabaseCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@
2020

2121
final class InstallDatabaseCommand extends AbstractInstallCommand
2222
{
23+
protected static $defaultName = 'sylius:install:database';
24+
2325
protected function configure(): void
2426
{
2527
$this
26-
->setName('sylius:install:database')
2728
->setDescription('Install Sylius database.')
2829
->setHelp(<<<EOT
2930
The <info>%command.name%</info> command creates Sylius database.

src/Sylius/Bundle/CoreBundle/Command/InstallSampleDataCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@
2222

2323
final class InstallSampleDataCommand extends AbstractInstallCommand
2424
{
25+
protected static $defaultName = 'sylius:install:sample-data';
26+
2527
protected function configure(): void
2628
{
2729
$this
28-
->setName('sylius:install:sample-data')
2930
->setDescription('Install sample data into Sylius.')
3031
->setHelp(<<<EOT
3132
The <info>%command.name%</info> command loads the sample data for Sylius.

src/Sylius/Bundle/CoreBundle/Command/SetupCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@
2727

2828
final class SetupCommand extends AbstractInstallCommand
2929
{
30+
protected static $defaultName = 'sylius:install:setup';
31+
3032
protected function configure(): void
3133
{
3234
$this
33-
->setName('sylius:install:setup')
3435
->setDescription('Sylius configuration setup.')
3536
->setHelp(<<<EOT
3637
The <info>%command.name%</info> command allows user to configure basic Sylius data.

src/Sylius/Bundle/CoreBundle/Command/ShowAvailablePluginsCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
final class ShowAvailablePluginsCommand extends Command
2424
{
25+
protected static $defaultName = 'sylius:show-available-plugins';
26+
2527
/**
2628
* @var iterable<PluginInfo>
2729
*
@@ -32,7 +34,6 @@ final class ShowAvailablePluginsCommand extends Command
3234

3335
protected function configure(): void
3436
{
35-
$this->setName('sylius:show-available-plugins');
3637
$this->setDescription('Shows official Sylius Plugins');
3738
$this->configurePlugins();
3839
}

0 commit comments

Comments
 (0)
0