phpstan-phpunit icon indicating copy to clipboard operation
phpstan-phpunit copied to clipboard

suggest `assertArrayHasKey` after `assertTrue(isset($x))`

Open staabm opened this issue 1 month ago • 0 comments

-$this->assertTrue(isset($anything["foo"]), "message");
+$this->assertArrayHasKey("foo", $anything, "message");

similar to AssertSameNullExpectedRule and others

could be auto-fixable.


inspired by rector

staabm avatar Nov 12 '25 14:11 staabm