| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | 7 | public function createEmptyResponse(JsonRpcRequest $fromRequest = null) : JsonRpcResponse |
|
| 20 | { |
||
| 21 | 7 | if (null === $fromRequest) { |
|
| 22 | 3 | return new JsonRpcResponse(); |
|
| 23 | } |
||
| 24 | |||
| 25 | 4 | $response = (new JsonRpcResponse($fromRequest->getJsonRpc())) |
|
| 26 | 4 | ->setIsNotification($fromRequest->isNotification()) |
|
| 27 | ; |
||
| 28 | |||
| 29 | 4 | if ($fromRequest->getId()) { |
|
| 30 | 3 | $response->setId($fromRequest->getId()); |
|
| 31 | } |
||
| 32 | |||
| 33 | 4 | return $response; |
|
| 34 | } |
||
| 65 |