| Conditions | 4 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | 2 | public function execute( |
|
| 21 | RequestInterface $request, |
||
| 22 | ExpectationCollection $expectations = null |
||
| 23 | ): void { |
||
| 24 | 2 | $this->requestValidator->validate($request); |
|
| 25 | 2 | $response = $this->client->sendRequest($request); |
|
| 26 | |||
| 27 | 2 | if ($expectations !== null) { |
|
| 28 | 2 | foreach ($expectations as $expectation) { |
|
| 29 | 2 | $error = $expectation->verify($response); |
|
| 30 | 2 | if ($error !== null) { |
|
| 31 | 1 | throw $error; |
|
| 32 | } |
||
| 33 | } |
||
| 34 | } |
||
| 35 | |||
| 36 | 1 | $this->responseValidator->validate($response, $request); |
|
| 37 | } |
||
| 39 |