Skip to content

Commit afc7299

Browse files
authored
Merge pull request #275 from vudaltsov/lazy-commands
Lazy console commands
2 parents 29089c8 + 7d07d66 commit afc7299

12 files changed

+42
-22
lines changed

Command/MigrationsDiffDoctrineCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@
1919
*/
2020
class MigrationsDiffDoctrineCommand extends DiffCommand
2121
{
22+
/** @var string */
23+
protected static $defaultName = 'doctrine:migrations:diff';
24+
2225
protected function configure() : void
2326
{
2427
parent::configure();
2528

2629
$this
27-
->setName('doctrine:migrations:diff')
2830
->addOption('db', null, InputOption::VALUE_REQUIRED, 'The database connection to use for this command.')
2931
->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command.')
3032
->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection to use for this command.');

Command/MigrationsDumpSchemaDoctrineCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@
1818
*/
1919
class MigrationsDumpSchemaDoctrineCommand extends DumpSchemaCommand
2020
{
21+
/** @var string */
22+
protected static $defaultName = 'doctrine:migrations:dump-schema';
23+
2124
protected function configure() : void
2225
{
2326
parent::configure();
2427

2528
$this
26-
->setName('doctrine:migrations:dump-schema')
2729
->addOption('db', null, InputOption::VALUE_REQUIRED, 'The database connection to use for this command.')
2830
->addOption('em', null, InputOption::VALUE_REQUIRED, 'The entity manager to use for this command.')
2931
->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection to use for this command.');

Command/MigrationsExecuteDoctrineCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@
1818
*/
1919
class MigrationsExecuteDoctrineCommand extends ExecuteCommand
2020
{
21+
/** @var string */
22+
protected static $defaultName = 'doctrine:migrations:execute';
23+
2124
protected function configure() : void
2225
{
2326
parent::configure();
2427

2528
$this
26-
->setName('doctrine:migrations:execute')
2729
->addOption('db', null, InputOption::VALUE_REQUIRED, 'The database connection to use for this command.')
2830
->addOption('em', null, InputOption::VALUE_REQUIRED, 'The entity manager to use for this command.')
2931
->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection to use for this command.');

Command/MigrationsGenerateDoctrineCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@
1818
*/
1919
class MigrationsGenerateDoctrineCommand extends GenerateCommand
2020
{
21+
/** @var string */
22+
protected static $defaultName = 'doctrine:migrations:generate';
23+
2124
protected function configure() : void
2225
{
2326
parent::configure();
2427

2528
$this
26-
->setName('doctrine:migrations:generate')
2729
->addOption('db', null, InputOption::VALUE_REQUIRED, 'The database connection to use for this command.')
2830
->addOption('em', null, InputOption::VALUE_REQUIRED, 'The entity manager to use for this command.')
2931
->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection to use for this command.');

Command/MigrationsLatestDoctrineCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@
1818
*/
1919
class MigrationsLatestDoctrineCommand extends LatestCommand
2020
{
21+
/** @var string */
22+
protected static $defaultName = 'doctrine:migrations:latest';
23+
2124
protected function configure() : void
2225
{
2326
parent::configure();
2427

2528
$this
26-
->setName('doctrine:migrations:latest')
2729
->addOption('db', null, InputOption::VALUE_REQUIRED, 'The database connection to use for this command.')
2830
->addOption('em', null, InputOption::VALUE_REQUIRED, 'The entity manager to use for this command.')
2931
->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection to use for this command.');

Command/MigrationsMigrateDoctrineCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@
1818
*/
1919
class MigrationsMigrateDoctrineCommand extends MigrateCommand
2020
{
21+
/** @var string */
22+
protected static $defaultName = 'doctrine:migrations:migrate';
23+
2124
protected function configure() : void
2225
{
2326
parent::configure();
2427

2528
$this
26-
->setName('doctrine:migrations:migrate')
2729
->addOption('db', null, InputOption::VALUE_REQUIRED, 'The database connection to use for this command.')
2830
->addOption('em', null, InputOption::VALUE_REQUIRED, 'The entity manager to use for this command.')
2931
->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection to use for this command.');

Command/MigrationsRollupDoctrineCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@
1818
*/
1919
class MigrationsRollupDoctrineCommand extends RollupCommand
2020
{
21+
/** @var string */
22+
protected static $defaultName = 'doctrine:migrations:rollup';
23+
2124
protected function configure() : void
2225
{
2326
parent::configure();
2427

2528
$this
26-
->setName('doctrine:migrations:rollup')
2729
->addOption('db', null, InputOption::VALUE_REQUIRED, 'The database connection to use for this command.')
2830
->addOption('em', null, InputOption::VALUE_REQUIRED, 'The entity manager to use for this command.')
2931
->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection to use for this command.');

Command/MigrationsStatusDoctrineCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@
1818
*/
1919
class MigrationsStatusDoctrineCommand extends StatusCommand
2020
{
21+
/** @var string */
22+
protected static $defaultName = 'doctrine:migrations:status';
23+
2124
protected function configure() : void
2225
{
2326
parent::configure();
2427

2528
$this
26-
->setName('doctrine:migrations:status')
2729
->addOption('db', null, InputOption::VALUE_REQUIRED, 'The database connection to use for this command.')
2830
->addOption('em', null, InputOption::VALUE_REQUIRED, 'The entity manager to use for this command.')
2931
->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection to use for this command.');

Command/MigrationsUpToDateDoctrineCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@
1818
*/
1919
class MigrationsUpToDateDoctrineCommand extends UpToDateCommand
2020
{
21+
/** @var string */
22+
protected static $defaultName = 'doctrine:migrations:up-to-date';
23+
2124
protected function configure() : void
2225
{
2326
parent::configure();
2427

2528
$this
26-
->setName('doctrine:migrations:up-to-date')
2729
->addOption('db', null, InputOption::VALUE_REQUIRED, 'The database connection to use for this command.')
2830
->addOption('em', null, InputOption::VALUE_REQUIRED, 'The entity manager to use for this command.')
2931
->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection to use for this command.');

Command/MigrationsVersionDoctrineCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@
1818
*/
1919
class MigrationsVersionDoctrineCommand extends VersionCommand
2020
{
21+
/** @var string */
22+
protected static $defaultName = 'doctrine:migrations:version';
23+
2124
protected function configure() : void
2225
{
2326
parent::configure();
2427

2528
$this
26-
->setName('doctrine:migrations:version')
2729
->addOption('db', null, InputOption::VALUE_REQUIRED, 'The database connection to use for this command.')
2830
->addOption('em', null, InputOption::VALUE_REQUIRED, 'The entity manager to use for this command.')
2931
->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection to use for this command.');

0 commit comments

Comments
 (0)