Run Rector on your code to see what it can do for you:

 <?php
 
+use Symfony\Component\Console\Attribute\AsCommand;
 use Symfony\Component\Console\Command\Command;
 
+#[AsCommand(description: 'description of the command', name: 'app:'.self::COMMAND.':process')]
 final class MyCommand extends Command
 {
     private const COMMAND = 'command';
     
-    protected static $defaultName = 'app:'.self::COMMAND.':process';
-    
-    protected function configure(): void
-    {
-        $this->setDescription('description of the command');
+    protected function configure(): void
+    {
     }
     
     protected function execute(InputInterface $input, OutputInterface $output): int
     {
         //...
     }
}
PHP snippet to change
Config  rector.php
Rector version: 1.2.5 - released at 2024-09-08 17:51