rector-symfony
rector-symfony copied to clipboard
Use Symfony Command constants for return of execute
With https://github.com/rectorphp/rector-symfony/blob/main/docs/rector_rules_overview.md#consoleexecutereturnintrector we got explicit return type int but it is even nicer to use Symfony Command constants they also use it as example in there documentation see https://symfony.com/doc/current/console.html#creating-a-command
Example:
use Symfony\Component\Console\Command\Command;
class SomeCommand extends Command
{
public function execute(InputInterface $input, OutputInterface $output): int
{
- return 0;
+ return Command::SUCCESS;
}
}
If you say its a nice addition a new rule should be added as its not part off ConsoleExecuteReturnIntRector
right?
This would be great addition :+1:
Okay i will work on this
Fixed with https://github.com/rectorphp/rector-symfony/pull/256