CommandConstantReturnCodeRector

Changes int return from execute to use Symfony Command constants.

 class SomeCommand extends Command
 {
     protected function execute(InputInterface $input, OutputInterface $output): int
     {
-        return 0;
+        return \Symfony\Component\Console\Command\Command::SUCCESS;
     }

 }

Configure your rector.php:

<?php

use Rector\Config\RectorConfig;
use Rector\Symfony\Symfony51\Rector\ClassMethod\CommandConstantReturnCodeRector;

return RectorConfig::configure()
    ->withRules([
        CommandConstantReturnCodeRector::class,
    ]);
SETS:  symfony/* 5.1