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: \"Scope not available on \"PhpParser\\Node\\Expr\\Array_\" node. Fix scope refresh on changed nodes first\"\nRun Rector with \"--debug\" option and post the report here: https://github.com/rectorphp/rector/issues/new", "file": "/var/www/storage/demo/35glzrxkdffne62rw3i2/rector_analyzed_file.php", "line": 19 } ] }
Run Rector on your code to see what it can do for you:
PHP snippet to change
<?php declare(strict_types=1); function foo(mixed ...$args): void {} class ReproCase { public function test(): void { foo('first', ['key' => 'value'], c: 'test'); } }
Config
rector.php
<?php use Rector\Config\RectorConfig; use Rector\Php81\Rector\Array_\ArrayToFirstClassCallableRector; return RectorConfig::configure() ->withRules([ ArrayToFirstClassCallableRector::class ]);
Run Rector
Rector version:
84fe92
- released at 2026-04-11 21:41