phpstan / phpstan-phpunit

PHPUnit extensions and rules for PHPStan
MIT License
468 stars 47 forks source link

Add partial support for assertContainsOnlyInstancesOf #180

Closed villfa closed 1 year ago

villfa commented 1 year ago

Add support for assertContainsOnlyInstancesOf when the 2nd argument is an array. The behaviour is not changed when it is an instance of Traversable.

See #158

villfa commented 1 year ago

~I move this PR back to draft since I forgot to consider the argument could be an instance of Traversable...~ EDIT: I've added a test to be sure there is no regression when the 2nd argument is an instance of Traversable, in order to make this PR ready to be reviewed.

ondrejmirtes commented 1 year ago

Thank you.