Closed michaelsadlon closed 6 years ago
Found the issue. Some of base Collection
class methods use func_num_args()
to change their behavior when some optional arguments are omitted, mostly to handle passing a callback as an argument to methods like contains()
.
That means we just cannot pass blindly all arguments to the parent
class, but use the same approach to call the parent method with exactly what the method was called.
I was working on upgrading to 5.5 and ran into some issues with the CollectionProxy. To be exact I upgraded analogue/orm from 5.4.0 to 5.5.18.
Specifically:
Creating a new Collection from the CollectionProxy and then calling the above methods works as expected.
In the case of random passing in null will emulate the correct behavior since that is the default value in the base Collection random method. The contains method I think just needs to pass the arguments correctly.
There may be other methods with issues. I did not extensively test them all.