Conditions | 4 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
50 | 6 | private function call(RpcRequestInterface $request) |
|
51 | { |
||
52 | 6 | $tip = array_shift($this->queue); |
|
53 | |||
54 | 6 | if (null === $tip) { |
|
55 | 2 | throw MockClientException::emptyQueue($request); |
|
56 | } |
||
57 | |||
58 | 6 | list($response, $filter) = $tip; |
|
59 | |||
60 | 6 | if (is_callable($filter) && !$filter($request)) { |
|
61 | 2 | throw MockClientException::filterFailed($request, $response); |
|
62 | } |
||
63 | |||
64 | 4 | return $response; |
|
65 | } |
||
66 | } |
||
67 |