phpspec/prophecy — pull request #19 by kagux (2013-05-16 16:51:57+00:00)
Title: Array entry token and shortcuts to match entry, key or value

Token comes with 3 shortcuts:
* ```Argument::hasEntry($key, $value)``` to check if array contains (key, value) pair.
* ```Argument::hasKey($key)``` to check if array contains key
* ```Argument::contains($value)``` to check if array contains value

Both ```$key``` and ```$value``` can be either exact values or tokens.
It only scores when both ```$key``` and ```$value``` score at least one same entry in the array.
The most debatable part is how to score matched entries. I ended up choosing to calculate it as ```(key_score + value_score) / 2``` and cap it at 8. It takes both tokens into account and should keep fair priorities.