Try Rector
Docs
Hire Team
Find Rule
Blog
Contact
AST
Try Rector
Docs
Hire Team
Find Rule
Blog
Contact
AST
Run Rector on your code to see what it can do for you:
// no change
PHP snippet to change
<?php final class Mage { public static function getStoreConfig(string $path) { } } class ClassNew { public const PATH = 'path'; } class ClassOld { public const PATH = 'path'; } class Other { public static function test() { Mage::getStoreConfig(\ClassOld::PATH); } }
Config
rector.php
<?php use Rector\Config\RectorConfig; use Rector\Arguments\Rector\ClassMethod\ReplaceArgumentDefaultValueRector; use Rector\Arguments\ValueObject\ReplaceArgumentDefaultValue; return RectorConfig::configure() ->withConfiguredRule(ReplaceArgumentDefaultValueRector::class, [new ReplaceArgumentDefaultValue(Mage::class, 'getStoreConfig', 0, 'ClassOld::PATH', 'ClassNew::PATH')]);
Run Rector
Rector version:
2d8958
- released at 2026-03-28 17:45