Conditions | 3 |
Paths | 3 |
Total Lines | 21 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 14 |
CRAP Score | 3.0026 |
Changes | 0 |
1 | <?php |
||
13 | 2 | public function onRpcException(GetExceptionResponseEvent $event) |
|
14 | { |
||
15 | 2 | $request = $event->getRequest(); |
|
16 | 2 | if (!$request instanceof JsonRpcRequestInterface) { |
|
17 | return; |
||
18 | } |
||
19 | |||
20 | 2 | $exception = $event->getException(); |
|
21 | |||
22 | 2 | if (!$exception instanceof AccessDeniedException) { |
|
23 | 1 | return; |
|
24 | } |
||
25 | |||
26 | 1 | $event->setException( |
|
27 | 1 | JsonRpcException::create( |
|
28 | 1 | JsonRpcError::METHOD_NOT_FOUND, |
|
29 | 1 | $exception->getMessage(), |
|
30 | 1 | $exception->getTrace() |
|
31 | 1 | ) |
|
32 | 1 | ); |
|
33 | 1 | } |
|
34 | } |
||
35 |