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: \"Call to undefined method Rector\\PhpParser\\Printer\\BetterStandardPrinter::pInterpolatedStringPart()\"\nRun Rector with \"--debug\" option and post the report here: https://github.com/rectorphp/rector/issues/new", "file": "/var/www/storage/demo/js26bq7wx3wglyaeny3s/rector_analyzed_file.php", "line": 579 } ] }
Run Rector on your code to see what it can do for you:
PHP snippet to change
<?php $markdown = 'a long string'; // parse tags $markdown = preg_replace_callback( '/\[([a-zA-Z0-9._-]+)\]/im', function (array $matches): string { $match = $matches[1]; $className = strtolower(Toolkit::toSlug($match)); return "<span class='tag tag-{$className}'>{$match}</span>"; }, (string) $markdown );
Config
rector.php
<?php use Rector\Config\RectorConfig; use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector; use Rector\ValueObject\PhpVersion; return RectorConfig::configure() ->withRules([ \Rector\DeadCode\Rector\Assign\RemoveDoubleAssignRector::class ]) // demonstrate specific PHP version ->withPhpVersion(PhpVersion::PHP_81);
Run Rector
Rector version:
2.2.14
- released at 2025-12-09 11:53