From 5b3a20ce9be751cb9818aad2d6f096cfcbaf1efe Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Tue, 31 Oct 2023 06:56:32 +0100 Subject: [PATCH] Remove overrides of deprecated static Command properties (#1370) Co-authored-by: Chris Rotter --- .../Migrations/Tools/Console/Command/CurrentCommand.php | 3 --- lib/Doctrine/Migrations/Tools/Console/Command/DiffCommand.php | 3 --- .../Migrations/Tools/Console/Command/DumpSchemaCommand.php | 3 --- .../Migrations/Tools/Console/Command/ExecuteCommand.php | 3 --- .../Migrations/Tools/Console/Command/GenerateCommand.php | 3 --- .../Migrations/Tools/Console/Command/LatestCommand.php | 3 --- lib/Doctrine/Migrations/Tools/Console/Command/ListCommand.php | 3 --- .../Migrations/Tools/Console/Command/MigrateCommand.php | 3 --- .../Migrations/Tools/Console/Command/RollupCommand.php | 3 --- .../Migrations/Tools/Console/Command/StatusCommand.php | 4 +--- .../Migrations/Tools/Console/Command/SyncMetadataCommand.php | 4 +--- .../Migrations/Tools/Console/Command/UpToDateCommand.php | 4 +--- .../Migrations/Tools/Console/Command/VersionCommand.php | 4 +--- 13 files changed, 4 insertions(+), 39 deletions(-) diff --git a/lib/Doctrine/Migrations/Tools/Console/Command/CurrentCommand.php b/lib/Doctrine/Migrations/Tools/Console/Command/CurrentCommand.php index b46ed83e0..af20d5598 100644 --- a/lib/Doctrine/Migrations/Tools/Console/Command/CurrentCommand.php +++ b/lib/Doctrine/Migrations/Tools/Console/Command/CurrentCommand.php @@ -17,9 +17,6 @@ #[AsCommand(name: 'migrations:current', description: 'Outputs the current version')] final class CurrentCommand extends DoctrineCommand { - /** @var string|null */ - protected static $defaultName = 'migrations:current'; - protected function configure(): void { $this diff --git a/lib/Doctrine/Migrations/Tools/Console/Command/DiffCommand.php b/lib/Doctrine/Migrations/Tools/Console/Command/DiffCommand.php index 6cf6ebd94..b65b13269 100644 --- a/lib/Doctrine/Migrations/Tools/Console/Command/DiffCommand.php +++ b/lib/Doctrine/Migrations/Tools/Console/Command/DiffCommand.php @@ -33,9 +33,6 @@ #[AsCommand(name: 'migrations:diff', description: 'Generate a migration by comparing your current database to your mapping information.')] final class DiffCommand extends DoctrineCommand { - /** @var string|null */ - protected static $defaultName = 'migrations:diff'; - protected function configure(): void { parent::configure(); diff --git a/lib/Doctrine/Migrations/Tools/Console/Command/DumpSchemaCommand.php b/lib/Doctrine/Migrations/Tools/Console/Command/DumpSchemaCommand.php index dd927db82..50bf81b61 100644 --- a/lib/Doctrine/Migrations/Tools/Console/Command/DumpSchemaCommand.php +++ b/lib/Doctrine/Migrations/Tools/Console/Command/DumpSchemaCommand.php @@ -29,9 +29,6 @@ #[AsCommand(name: 'migrations:dump-schema', description: 'Dump the schema for your database to a migration.')] final class DumpSchemaCommand extends DoctrineCommand { - /** @var string|null */ - protected static $defaultName = 'migrations:dump-schema'; - protected function configure(): void { parent::configure(); diff --git a/lib/Doctrine/Migrations/Tools/Console/Command/ExecuteCommand.php b/lib/Doctrine/Migrations/Tools/Console/Command/ExecuteCommand.php index 92d4101c4..c783cc9c1 100644 --- a/lib/Doctrine/Migrations/Tools/Console/Command/ExecuteCommand.php +++ b/lib/Doctrine/Migrations/Tools/Console/Command/ExecuteCommand.php @@ -28,9 +28,6 @@ #[AsCommand(name: 'migrations:execute', description: 'Execute one or more migration versions up or down manually.')] final class ExecuteCommand extends DoctrineCommand { - /** @var string|null */ - protected static $defaultName = 'migrations:execute'; - protected function configure(): void { $this diff --git a/lib/Doctrine/Migrations/Tools/Console/Command/GenerateCommand.php b/lib/Doctrine/Migrations/Tools/Console/Command/GenerateCommand.php index 3bddf9e4e..ae742675a 100644 --- a/lib/Doctrine/Migrations/Tools/Console/Command/GenerateCommand.php +++ b/lib/Doctrine/Migrations/Tools/Console/Command/GenerateCommand.php @@ -21,9 +21,6 @@ #[AsCommand(name: 'migrations:generate', description: 'Generate a blank migration class.')] final class GenerateCommand extends DoctrineCommand { - /** @var string|null */ - protected static $defaultName = 'migrations:generate'; - protected function configure(): void { $this diff --git a/lib/Doctrine/Migrations/Tools/Console/Command/LatestCommand.php b/lib/Doctrine/Migrations/Tools/Console/Command/LatestCommand.php index 5ce6af0c8..6731ede7f 100644 --- a/lib/Doctrine/Migrations/Tools/Console/Command/LatestCommand.php +++ b/lib/Doctrine/Migrations/Tools/Console/Command/LatestCommand.php @@ -17,9 +17,6 @@ #[AsCommand(name: 'migrations:latest', description: 'Outputs the latest version')] final class LatestCommand extends DoctrineCommand { - /** @var string|null */ - protected static $defaultName = 'migrations:latest'; - protected function configure(): void { $this diff --git a/lib/Doctrine/Migrations/Tools/Console/Command/ListCommand.php b/lib/Doctrine/Migrations/Tools/Console/Command/ListCommand.php index 86aa661f3..4f56d4df9 100644 --- a/lib/Doctrine/Migrations/Tools/Console/Command/ListCommand.php +++ b/lib/Doctrine/Migrations/Tools/Console/Command/ListCommand.php @@ -24,9 +24,6 @@ #[AsCommand(name: 'migrations:list', description: 'Display a list of all available migrations and their status.')] final class ListCommand extends DoctrineCommand { - /** @var string|null */ - protected static $defaultName = 'migrations:list'; - protected function configure(): void { $this diff --git a/lib/Doctrine/Migrations/Tools/Console/Command/MigrateCommand.php b/lib/Doctrine/Migrations/Tools/Console/Command/MigrateCommand.php index 76576724f..92ee54d9d 100644 --- a/lib/Doctrine/Migrations/Tools/Console/Command/MigrateCommand.php +++ b/lib/Doctrine/Migrations/Tools/Console/Command/MigrateCommand.php @@ -32,9 +32,6 @@ #[AsCommand(name: 'migrations:migrate', description: 'Execute a migration to a specified version or the latest available version.')] final class MigrateCommand extends DoctrineCommand { - /** @var string|null */ - protected static $defaultName = 'migrations:migrate'; - protected function configure(): void { $this diff --git a/lib/Doctrine/Migrations/Tools/Console/Command/RollupCommand.php b/lib/Doctrine/Migrations/Tools/Console/Command/RollupCommand.php index 1c97985d3..27ddeb6cb 100644 --- a/lib/Doctrine/Migrations/Tools/Console/Command/RollupCommand.php +++ b/lib/Doctrine/Migrations/Tools/Console/Command/RollupCommand.php @@ -17,9 +17,6 @@ #[AsCommand(name: 'migrations:rollup', description: 'Rollup migrations by deleting all tracked versions and insert the one version that exists.')] final class RollupCommand extends DoctrineCommand { - /** @var string|null */ - protected static $defaultName = 'migrations:rollup'; - protected function configure(): void { parent::configure(); diff --git a/lib/Doctrine/Migrations/Tools/Console/Command/StatusCommand.php b/lib/Doctrine/Migrations/Tools/Console/Command/StatusCommand.php index ce710dc91..242de90d8 100644 --- a/lib/Doctrine/Migrations/Tools/Console/Command/StatusCommand.php +++ b/lib/Doctrine/Migrations/Tools/Console/Command/StatusCommand.php @@ -15,12 +15,10 @@ #[AsCommand(name: 'migrations:status', description: 'View the status of a set of migrations.')] final class StatusCommand extends DoctrineCommand { - /** @var string|null */ - protected static $defaultName = 'migrations:status'; - protected function configure(): void { $this + ->setName('migrations:status') ->setAliases(['status']) ->setDescription('View the status of a set of migrations.') ->setHelp(<<<'EOT' diff --git a/lib/Doctrine/Migrations/Tools/Console/Command/SyncMetadataCommand.php b/lib/Doctrine/Migrations/Tools/Console/Command/SyncMetadataCommand.php index 3bb68ed57..4a3d330ac 100644 --- a/lib/Doctrine/Migrations/Tools/Console/Command/SyncMetadataCommand.php +++ b/lib/Doctrine/Migrations/Tools/Console/Command/SyncMetadataCommand.php @@ -11,14 +11,12 @@ #[AsCommand(name: 'migrations:sync-metadata-storage', description: 'Ensures that the metadata storage is at the latest version.')] final class SyncMetadataCommand extends DoctrineCommand { - /** @var string|null */ - protected static $defaultName = 'migrations:sync-metadata-storage'; - protected function configure(): void { parent::configure(); $this + ->setName('migrations:sync-metadata-storage') ->setAliases(['sync-metadata-storage']) ->setDescription('Ensures that the metadata storage is at the latest version.') ->setHelp(<<<'EOT' diff --git a/lib/Doctrine/Migrations/Tools/Console/Command/UpToDateCommand.php b/lib/Doctrine/Migrations/Tools/Console/Command/UpToDateCommand.php index dfcf07864..015ef6e30 100644 --- a/lib/Doctrine/Migrations/Tools/Console/Command/UpToDateCommand.php +++ b/lib/Doctrine/Migrations/Tools/Console/Command/UpToDateCommand.php @@ -28,12 +28,10 @@ #[AsCommand(name: 'migrations:up-to-date', description: 'Tells you if your schema is up-to-date.')] final class UpToDateCommand extends DoctrineCommand { - /** @var string|null */ - protected static $defaultName = 'migrations:up-to-date'; - protected function configure(): void { $this + ->setName('migrations:up-to-date') ->setAliases(['up-to-date']) ->setDescription('Tells you if your schema is up-to-date.') ->addOption('fail-on-unregistered', 'u', InputOption::VALUE_NONE, 'Whether to fail when there are unregistered extra migrations found') diff --git a/lib/Doctrine/Migrations/Tools/Console/Command/VersionCommand.php b/lib/Doctrine/Migrations/Tools/Console/Command/VersionCommand.php index 8397babc9..e5bc67268 100644 --- a/lib/Doctrine/Migrations/Tools/Console/Command/VersionCommand.php +++ b/lib/Doctrine/Migrations/Tools/Console/Command/VersionCommand.php @@ -27,14 +27,12 @@ #[AsCommand(name: 'migrations:version', description: 'Manually add and delete migration versions from the version table.')] final class VersionCommand extends DoctrineCommand { - /** @var string|null */ - protected static $defaultName = 'migrations:version'; - private bool $markMigrated; protected function configure(): void { $this + ->setName('migrations:version') ->setAliases(['version']) ->setDescription('Manually add and delete migration versions from the version table.') ->addArgument(