Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
41 | 3 | public function formatException(Exception $exception) |
|
42 | { |
||
43 | 3 | if ($exception instanceof HttpException) { |
|
44 | 1 | return $this->formatter->formatResponse($exception->getResponse()); |
|
45 | } |
||
46 | |||
47 | 2 | if ($exception instanceof TransferException) { |
|
48 | 1 | return sprintf('Transfer error: %s', $exception->getMessage()); |
|
49 | } |
||
50 | |||
51 | 1 | return sprintf('Unexpected exception of type "%s": %s', get_class($exception), $exception->getMessage()); |
|
52 | } |
||
53 | |||
70 |