Try Rector
Docs
Hire Team
Find Rule
Blog
Contact
AST
Try Rector
Docs
Hire Team
Find Rule
Blog
Contact
AST
Rector run Failed:
{ "totals": { "changed_files": 0, "errors": 1 }, "errors": [ { "message": "System error: \"Unsupported operand types: string & int\"\nRun Rector with \"--debug\" option and post the report here: https://github.com/rectorphp/rector/issues/new", "file": "/var/www/storage/demo/hrbelr0t9f1yohqpt7hi/rector_analyzed_file.php", "line": 84 } ] }
Run Rector on your code to see what it can do for you:
PHP snippet to change
<?php namespace App\Command\Alarms; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; #[AsCommand( name: 'ack:alarm', description: '', )] class AckAlarmCommand extends Command { protected function configure(): void { $this ->addOption( name: 'startDate', mode: InputOption::VALUE_REQUIRED, description: 'non empty description needed to reproduce the bug', ); } protected function execute(InputInterface $input, OutputInterface $output): int { return Command::SUCCESS; } }
Config
rector.php
<?php use Rector\Config\RectorConfig; use Rector\Symfony\Set\SymfonySetList; return RectorConfig::configure() ->withRules([\Rector\Symfony\Symfony73\Rector\Class_\InvokableCommandInputAttributeRector::class]);
Run Rector
Rector version:
6d81ea
- released at 2026-02-01 00:55