Find the best Rector rule to solve your problem. Searching through 675 rules.

Found 2 rules:

CommandConfigureToAttributeRector

Add Symfony\Component\Console\Attribute\AsCommand to Symfony Commands from configure()

+use Symfony\Component\Console\Attribute\AsCommand;
 use Symfony\Component\Console\Command\Command;

+#[AsCommand(name: 'sunshine', description: 'Some description')]
 final class SunshineCommand extends Command
 {
-    public function configure()
-    {
-        $this->setName('sunshine');
-        $this->setDescription('Some description');
-
-    }
 }

CommandPropertyToAttributeRector

Add Symfony\Component\Console\Attribute\AsCommand to Symfony Commands and remove the deprecated properties

+use Symfony\Component\Console\Attribute\AsCommand;
 use Symfony\Component\Console\Command\Command;

+#[AsCommand(name: 'sunshine', description: 'some description')]
 final class SunshineCommand extends Command
 {
-    public static $defaultName = 'sunshine';
-
-    public static $defaultDescription = 'some description';
 }