opened
avant1
username_0
When collaborator is defined with array or callable type hinting spec execution raises not really clear php warnings (something like *Argument 1 passed to method() must be array, object given*).

This PR makes such situations more clear (this can be espesially important for newcomers).

I've faced this problem when started working with phpspec, and I am not alone (see #710).
Invalid collaborator type hinting error handling
issue
created
avant1
username_0
Fixed problem on php5.3 (callable type was introduced in 5.4).
comment
created
ciaranmcnulty
username_1
This is a great addition. Perhaps it can also check for scalar type hints in PHP7, as they're also not something that's mockable.
comment
created
avant1
username_0
Thought about that too. In php7 was added [`ReflectionType` class](http://php.net/manual/en/class.reflectiontype.php), so check becomes even easier. I'll add appropriate changes later.
comment
created
avant1
username_0
Added necessary changes.
comment
created
avant1
username_0
Added some changes, also rebased on master.
comment
created
ciaranmcnulty
username_1
Thanks - great addition!
comment