assert icon indicating copy to clipboard operation
assert copied to clipboard

inArray / notInArray strict equality inconsistency

Open maryo opened this issue 7 years ago • 4 comments

inArray is an alias for choice. It passes true as third argument of in_array. On the other hand, notInArray does not use the third argument when calling in_array (=false). Is this intentional?

Shouldn't there be both versions?

maryo avatar Feb 16 '18 18:02 maryo

notInArray was initial drafted back in July 2016. I've asked the original author of the assertion to see if they have any opinion. As things stand, I suspect it was just an oversight.

Unless there's any specific feedback, I'll make both use strict comparison and release that next week.

rquadling avatar Feb 16 '18 21:02 rquadling

This wasn't intentional 😄 Definitely just an oversight!

mdavis1982 avatar Feb 16 '18 22:02 mdavis1982

:+1:

TomasVotruba avatar Feb 16 '18 22:02 TomasVotruba

@rquadling I've actually noticed it when I needed loose comparison :-). I know loose comparison is not as usual but if both inArray and choice do exactly the same then there is no loose assertion available. Maybe it's OK. Maybe there could be something like looseInArray to make it explicit without introducing a BC break.

maryo avatar Feb 16 '18 23:02 maryo