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