I see what you were trying to do with Collection:add() but making it capable of adding EITHER one item OR several items, is not going to work. At least not the way it's currently written. What if you want to add a traversable object?
// internally this will loop over the object and add its constituents to the collection, when the user's intention was most likely to simply add the object itself to the collection.
$collection->add(new SomeTraversableObject);
If you want to add multiple items with one call, I suggest one of the following:
I see what you were trying to do with Collection:add() but making it capable of adding EITHER one item OR several items, is not going to work. At least not the way it's currently written. What if you want to add a traversable object?
If you want to add multiple items with one call, I suggest one of the following:
UPDATE: I have left comments on the initial commit by @Plopix . It has this recommendation among others.