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: \"Attempt to assign property \"type\" on null\"\nRun Rector with \"--debug\" option and post the report here: https://github.com/rectorphp/rector/issues/new", "file": "/var/www/storage/demo/ekrnrxeclj1u3dqc8t0x/rector_analyzed_file.php", "line": 97 } ] }
Run Rector on your code to see what it can do for you:
PHP snippet to change
<?php function getRandomData(): array { return array_map(fn (): int => random_int(1, 100), range(0, 23)); }
Config
rector.php
<?php declare(strict_types=1); use Rector\Config\RectorConfig; use Rector\TypeDeclaration\Rector\FuncCall\AddArrayFunctionClosureParamTypeRector; return RectorConfig::configure() ->withRules([AddArrayFunctionClosureParamTypeRector::class]);
Run Rector
Rector version:
6a3101
- released at 2026-02-10 12:09