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: \"Name cannot be empty\"\nRun Rector with \"--debug\" option and post the report here: https://github.com/rectorphp/rector/issues/new", "file": "/var/www/storage/demo/zhwjh0ukhc6khakah90v/rector_analyzed_file.php", "line": 243 } ] }
Run Rector on your code to see what it can do for you:
PHP snippet to change
<?php #[Attribute] class Some { } /** * @Some(foo="") */ class WithEmptyString { }
Config
rector.php
<?php declare(strict_types=1); use Rector\Config\RectorConfig; use Rector\Php80\Rector\Class_\AnnotationToAttributeRector; use Rector\Php80\ValueObject\AnnotationToAttribute; return static function (RectorConfig $rectorConfig): void { $rectorConfig->ruleWithConfiguration(AnnotationToAttributeRector::class, [ new AnnotationToAttribute('Some', null, ['foo']), ]); };
Run Rector
Rector version:
5b90a0
- released at 2026-01-30 23:38