From 6a9e7918a06ab223f04a474fb5a62a74adacb4dc Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Mon, 5 May 2025 16:13:47 +0200 Subject: [PATCH] [7.3] Update InvokableCommandRector to InvokableCommandInputAttributeRector to improve discoverability --- config/sets/symfony/symfony5/symfony53.php | 1 - config/sets/symfony/symfony73.php | 4 ++-- .../Fixture/skip_has_help_attribute_command.php.inc | 2 +- .../Fixture/some_command.php.inc | 4 ++-- .../Fixture/some_command_with_method_chaining.php.inc | 4 ++-- .../Fixture/some_command_with_set_help.php.inc | 4 ++-- .../InvokableCommandInputAttributeRectorTest.php} | 4 ++-- .../config/configured_rule.php | 10 ++++++++++ .../InvokableCommandRector/config/configured_rule.php | 10 ---------- ...or.php => InvokableCommandInputAttributeRector.php} | 4 ++-- 10 files changed, 23 insertions(+), 24 deletions(-) rename rules-tests/Symfony73/Rector/Class_/{InvokableCommandRector => InvokableCommandInputAttributeRector}/Fixture/some_command.php.inc (95%) rename rules-tests/Symfony73/Rector/Class_/{InvokableCommandRector => InvokableCommandInputAttributeRector}/Fixture/some_command_with_method_chaining.php.inc (95%) rename rules-tests/Symfony73/Rector/Class_/{InvokableCommandRector => InvokableCommandInputAttributeRector}/Fixture/some_command_with_set_help.php.inc (96%) rename rules-tests/Symfony73/Rector/Class_/{InvokableCommandRector/InvokableCommandRectorTest.php => InvokableCommandInputAttributeRector/InvokableCommandInputAttributeRectorTest.php} (84%) create mode 100644 rules-tests/Symfony73/Rector/Class_/InvokableCommandInputAttributeRector/config/configured_rule.php delete mode 100644 rules-tests/Symfony73/Rector/Class_/InvokableCommandRector/config/configured_rule.php rename rules/Symfony73/Rector/Class_/{InvokableCommandRector.php => InvokableCommandInputAttributeRector.php} (98%) diff --git a/config/sets/symfony/symfony5/symfony53.php b/config/sets/symfony/symfony5/symfony53.php index 6f02d3819..b54037e56 100644 --- a/config/sets/symfony/symfony5/symfony53.php +++ b/config/sets/symfony/symfony5/symfony53.php @@ -3,7 +3,6 @@ declare(strict_types=1); use Rector\Config\RectorConfig; -use Rector\Symfony\Symfony53\Rector\StaticPropertyFetch\KernelTestCaseContainerPropertyDeprecationRector; # https://github.com/symfony/symfony/blob/5.4/UPGRADE-5.3.md diff --git a/config/sets/symfony/symfony73.php b/config/sets/symfony/symfony73.php index 1896a5e3e..2c2ae0ad4 100644 --- a/config/sets/symfony/symfony73.php +++ b/config/sets/symfony/symfony73.php @@ -4,9 +4,9 @@ use Rector\Config\RectorConfig; use Rector\Symfony\Symfony73\Rector\Class_\CommandHelpToAttributeRector; -use Rector\Symfony\Symfony73\Rector\Class_\InvokableCommandRector; +use Rector\Symfony\Symfony73\Rector\Class_\InvokableCommandInputAttributeRector; // @see https://github.com/symfony/symfony/blame/7.3/UPGRADE-7.3.md return RectorConfig::configure() - ->withRules([CommandHelpToAttributeRector::class, InvokableCommandRector::class]); + ->withRules([CommandHelpToAttributeRector::class, InvokableCommandInputAttributeRector::class]); diff --git a/rules-tests/Symfony73/Rector/Class_/CommandHelpToAttributeRector/Fixture/skip_has_help_attribute_command.php.inc b/rules-tests/Symfony73/Rector/Class_/CommandHelpToAttributeRector/Fixture/skip_has_help_attribute_command.php.inc index e559f801c..65f901589 100644 --- a/rules-tests/Symfony73/Rector/Class_/CommandHelpToAttributeRector/Fixture/skip_has_help_attribute_command.php.inc +++ b/rules-tests/Symfony73/Rector/Class_/CommandHelpToAttributeRector/Fixture/skip_has_help_attribute_command.php.inc @@ -1,6 +1,6 @@ rule(InvokableCommandInputAttributeRector::class); +}; diff --git a/rules-tests/Symfony73/Rector/Class_/InvokableCommandRector/config/configured_rule.php b/rules-tests/Symfony73/Rector/Class_/InvokableCommandRector/config/configured_rule.php deleted file mode 100644 index a96cce4be..000000000 --- a/rules-tests/Symfony73/Rector/Class_/InvokableCommandRector/config/configured_rule.php +++ /dev/null @@ -1,10 +0,0 @@ -rule(InvokableCommandRector::class); -}; diff --git a/rules/Symfony73/Rector/Class_/InvokableCommandRector.php b/rules/Symfony73/Rector/Class_/InvokableCommandInputAttributeRector.php similarity index 98% rename from rules/Symfony73/Rector/Class_/InvokableCommandRector.php rename to rules/Symfony73/Rector/Class_/InvokableCommandInputAttributeRector.php index fb8abe30e..41fc77197 100644 --- a/rules/Symfony73/Rector/Class_/InvokableCommandRector.php +++ b/rules/Symfony73/Rector/Class_/InvokableCommandInputAttributeRector.php @@ -29,9 +29,9 @@ * @see https://github.com/symfony/symfony-docs/issues/20553 * @see https://github.com/symfony/symfony/pull/59340 * - * @see \Rector\Symfony\Tests\Symfony73\Rector\Class_\InvokableCommandRector\InvokableCommandRectorTest + * @see \Rector\Symfony\Tests\Symfony73\Rector\Class_\InvokableCommandInputAttributeRector\InvokableCommandRectorTest */ -final class InvokableCommandRector extends AbstractRector +final class InvokableCommandInputAttributeRector extends AbstractRector { private const MIGRATED_CONFIGURE_CALLS = ['addArgument', 'addOption'];