From 88e3a55ed7d72c6ee1bf224c28f811b27ebe21b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Fri, 20 Jun 2025 11:27:04 +0200 Subject: [PATCH] [Dotenv] Remove `DebugCommand::$defaultName` and `$defaultDescription` --- .../Console/Tests/Command/CommandTest.php | 15 --------------- .../Component/Dotenv/Command/DebugCommand.php | 10 ---------- src/Symfony/Component/Form/CHANGELOG.md | 5 +++++ 3 files changed, 5 insertions(+), 25 deletions(-) diff --git a/src/Symfony/Component/Console/Tests/Command/CommandTest.php b/src/Symfony/Component/Console/Tests/Command/CommandTest.php index 87c9031afff67..ac01284ef5f5e 100644 --- a/src/Symfony/Component/Console/Tests/Command/CommandTest.php +++ b/src/Symfony/Component/Console/Tests/Command/CommandTest.php @@ -463,14 +463,6 @@ public function testCommandAttribute() $this->assertSame(['f'], $command->getAliases()); } - public function testAttributeOverridesProperty() - { - $command = new MyAnnotatedCommand(); - - $this->assertSame('my:command', $command->getName()); - $this->assertSame('This is a command I wrote all by myself', $command->getDescription()); - } - public function testDefaultCommand() { $apl = new Application(); @@ -507,10 +499,3 @@ class Php8Command2 extends Command { } -#[AsCommand(name: 'my:command', description: 'This is a command I wrote all by myself')] -class MyAnnotatedCommand extends Command -{ - protected static $defaultName = 'i-shall-be-ignored'; - - protected static $defaultDescription = 'This description should be ignored.'; -} diff --git a/src/Symfony/Component/Dotenv/Command/DebugCommand.php b/src/Symfony/Component/Dotenv/Command/DebugCommand.php index 5729b94cbd8d8..9438a69e9e10c 100644 --- a/src/Symfony/Component/Dotenv/Command/DebugCommand.php +++ b/src/Symfony/Component/Dotenv/Command/DebugCommand.php @@ -30,16 +30,6 @@ #[AsCommand(name: 'debug:dotenv', description: 'List all dotenv files with variables and values')] final class DebugCommand extends Command { - /** - * @deprecated since Symfony 6.1 - */ - protected static $defaultName = 'debug:dotenv'; - - /** - * @deprecated since Symfony 6.1 - */ - protected static $defaultDescription = 'List all dotenv files with variables and values'; - public function __construct( private string $kernelEnvironment, private string $projectDirectory, diff --git a/src/Symfony/Component/Form/CHANGELOG.md b/src/Symfony/Component/Form/CHANGELOG.md index b74d43e79d23f..715a907176cec 100644 --- a/src/Symfony/Component/Form/CHANGELOG.md +++ b/src/Symfony/Component/Form/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +8.0 +--- + + * Remove `$defaultName` and `$defaultDescription` properties from `DebugCommand` command, configuration is done through the `#[AsCommand]` attribute + 7.4 ---