IMO, it's better to mirror the use of the collection method inside Set::contains() instead of using in_array, since items seems to be a Collection object. You get more functionality that way and it's more Laravel-ish.
I build things with my hands. The human behind Shift - https://laravelshift.com, master of Git - https://gettinggit.com, and author of "BaseCode" - https://basecodefieldguide.com
IMO, it's better to mirror the use of the collection method inside Set::contains() instead of using in_array, since
items
seems to be a Collection object. You get more functionality that way and it's more Laravel-ish.I see your suggestion. However, it's important to remember an array is a collection. No need to introduce an entire framework just to use one method.
Ah, I see that the other calls are to the Set class
size
andcontains
. I misread - I thought it was calling those onitems
. My bad. You are correct.