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

AssertEqualsIsDiscouraged

Open mhujer opened this issue 7 years ago • 5 comments

This rule is even more opinionated than the previous ones.

If you don't think it should be included in PHPStan, I can change it and keep only the first part (which suggests assertSame in for the same types)

mhujer avatar Dec 27 '17 15:12 mhujer

I submitted a review 😊 Also please rebase your branch on master and fix PHP 7.1-related CS errors.

ondrejmirtes avatar Dec 28 '17 15:12 ondrejmirtes

R4R @ondrejmirtes (I kept the fixes in the separate commits for easier review)

mhujer avatar Dec 28 '17 16:12 mhujer

Any feedback on this one?

mhujer avatar Feb 02 '18 07:02 mhujer

TBH I don't think this belongs here directly, it should be in phpstan-strict-rules (or i.e. phpstan-phpunit-strict-rules), or at least in separate ruleset (i.e. strict-rules.neon).

Majkl578 avatar Aug 18 '18 02:08 Majkl578

I just made a very similar rule to my package, check it out and feel free to comment.

It forbids assertEquals with any scalar type, no matter whether the two arguments are of the same type or not.

https://github.com/ikvasnica/phpstan-clean-test/pull/12

ikvasnica avatar Feb 03 '20 01:02 ikvasnica