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\\MethodCall\" 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/ynrgymrje1t0ld2bueyv/rector_analyzed_file.php", "line": 19 } ] }
Run Rector on your code to see what it can do for you:
PHP snippet to change
<?php trait IsRequest { public array $cookies { get => get(CookieManager::class)->all(); } }
Config
rector.php
<?php declare(strict_types=1); use Rector\CodeQuality\Rector\ClassMethod\OptionalParametersAfterRequiredRector; use Rector\Config\RectorConfig; return RectorConfig::configure() ->withRules([OptionalParametersAfterRequiredRector::class]);
Run Rector
Rector version:
f9b295
- released at 2025-09-06 07:29