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: \"PhpParser\\Node\\Stmt\\ClassLike::getMethod(): Argument #1 ($name) must be of type string, null given, called in /var/www/vendor/rector/rector/vendor/rector/rector-phpunit/rules/CodeQuality/Rector/Class_/AddParamTypeFromDependsRector.php on line 126\"\nRun Rector with \"--debug\" option and post the report here: https://github.com/rectorphp/rector/issues/new", "file": "/var/www/storage/demo/ixe06vfftpc32u0l6n2a/rector_analyzed_file.php", "line": 99 } ] }
Run Rector on your code to see what it can do for you:
PHP snippet to change
<?php use PHPUnit\Framework\TestCase; final class SkipNoDepends extends TestCase { public function test(): \stdClass { return new \stdClass(); } public function testNoDepends($value) { } }
Config
rector.php
<?php declare(strict_types=1); use Rector\Config\RectorConfig; use Rector\PHPUnit\CodeQuality\Rector\Class_\AddParamTypeFromDependsRector; return RectorConfig::configure() ->withRules([AddParamTypeFromDependsRector::class]);
Run Rector
Rector version:
e040c5
- released at 2026-01-11 00:45