Moves $this->setHelp() to the "help" named argument of #[AsCommand]
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
-#[AsCommand(name: 'app:some')]
+#[AsCommand(name: 'app:some', help: <<<'TXT'
+Some help text
+TXT)]
final class SomeCommand extends Command
{
- protected function configure(): void
- {
- $this->setHelp('Some help text');
- }
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\Symfony\Symfony73\Rector\Class_\CommandHelpToAttributeRector;
return RectorConfig::configure()
->withRules([
CommandHelpToAttributeRector::class,
]);