ppi/framework — comment on commit 2787be7271dbe0668e2659832ae3dd46a4668575
File: PPI/Request/Cookie.php line 26
By avdg:

I know how hard you disagree at this. But I still think that making the distinction between array and null should tell whether we use mocks or not.

For me, there are at least several reasons to use the distinction between arrays and null.
- Simple usage: not passing an argument always disables mocking, while passing an array always results in a mock.
- Typing: this interface would be more compatible with type oriented languages (sad/good php isn't)
- Avoids unexpected behavior: Suppose we know the value we pass is an array but don't know the content of it. It would be making much more sense if the behavior stays the same in every case. And what if we deal with an empty array, should we make up data on our own?
- What if we do want to have an empty mock, just passing a null would already result in a non-mocked object. Forcing an empty array to not allow mocking would result in 1 feature that tends up to be removed, but still duplicates the behavior of passing null.

While I'm still curious about consistency, I'm pretty sure we should handle an empty array as mock. But I still give you the chose to make the decision and deal with the consequences.