phpspec/prophecy — pull request #16 by kagux (2013-05-16 14:31:07+00:00)
Title: Logical AND token and a shortcut for it

This token allows adding multiple constraints to a single argument.
The shortcut is ```Argument::allOf```, which accepts a list of tokens as argument.
It scores argument only when all tokens from the list score it.
Final score is maximum of tokens' scores.
```
function it_should_dispatch_proper_event($dispatcher)
{
$dispatcher->dispatch(Argument::allOf(Argument::type('\Event'), Argument::which('getName','some_event')))
$this->run();
}
```
The syntax could be improved via wrapper to be something like:
``` Argument::all()->type('\Event')->which('getName','some_event') ```

Or via slightly more invasive change it could simply be:
``` Argument::type('\Event')->which('getName','some_event') ```