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: \"Rector\\Rector\\AbstractRector::getType(): Argument #1 ($node) must be of type PhpParser\\Node, null given, called in /var/www/vendor/rector/rector/vendor/rector/rector-phpunit/rules/PHPUnit90/Rector/MethodCall/SpecificAssertContainsWithoutIdentityRector.php on line 84\"\nRun Rector with \"--debug\" option and post the report here: https://github.com/rectorphp/rector/issues/new", "file": "/var/www/storage/demo/i0pj2b4mxudiqahprtii/rector_analyzed_file.php", "line": 196 } ] }
Run Rector on your code to see what it can do for you:
PHP snippet to change
<?php namespace Rector\PHPUnit\Tests\PHPUnit90\Rector\MethodCall\SpecificAssertContainsWithoutIdentityRector\Fixture; use PHPUnit\Framework\TestCase; use stdClass; final class SkipNoSecondArg extends TestCase { public function test() { $objects = [ new stdClass(), new stdClass(), new stdClass() ]; $this->transport()->queue()->assertContains(new stdClass()); } }
Config
rector.php
<?php declare(strict_types=1); use Rector\Config\RectorConfig; use Rector\PHPUnit\PHPUnit90\Rector\MethodCall\SpecificAssertContainsWithoutIdentityRector; return static function (RectorConfig $rectorConfig): void { $rectorConfig->rule(SpecificAssertContainsWithoutIdentityRector::class); };
Run Rector
Rector version:
b855ff
- released at 2026-01-22 19:37