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: \"PHPStan\\Analyser\\Fiber\\FiberNodeScopeResolver::callNodeCallback(): Argument #2 ($node) must be of type PhpParser\\Node, null given, called in phar:///var/www/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php on line 2639\"\nRun Rector with \"--debug\" option and post the report here: https://github.com/rectorphp/rector/issues/new", "file": "/var/www/storage/demo/qnbcqwal8wbysr3zm511/rector_analyzed_file.php", "line": 24 } ] }
Run Rector on your code to see what it can do for you:
PHP snippet to change
<?php function modify_shipping_rate_cost($cost, $rate) { list(, $instance_id) = explode(':', $rate->id); }
Config
rector.php
<?php declare(strict_types=1); use Rector\Config\RectorConfig; use Rector\Php71\Rector\List_\ListToArrayDestructRector; return RectorConfig::configure() ->withRules([ListToArrayDestructRector::class]);
Run Rector
Rector version:
036cfd
- released at 2026-02-24 16:36