Try Rector
Documentation
Hire Team
Blog
Contact
Try Rector
Documentation
Hire Team
Blog
Contact
Rector run Failed:
{ "totals": { "changed_files": 0, "errors": 1 }, "errors": [ { "message": "Rector\\DeadCode\\ConditionResolver::resolveArgumentValue(): Return value must be of type ?int, float returned", "file": "../storage/demo/yzon5q5alchpfmcwxvvf/rector_analyzed_file.php", "line": 117 } ] }
Run Rector on your code to see what it can do for you:
PHP snippet to change
<?php $result = version_compare(PHP_VERSION, 7.3, '>=') ? "yay" : "nay";
Config
rector.php
<?php use Rector\Config\RectorConfig; use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector; use Rector\ValueObject\PhpVersion; return RectorConfig::configure() ->withRules([ TypedPropertyFromAssignsRector::class ]);
Run Rector
Rector version:
d8e259
- released at 2026-07-20 09:49