Conditions | 2 |
Paths | 1 |
Total Lines | 22 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
27 | public function handle() |
||
28 | { |
||
29 | $errorData = Formatter::formatExceptionAsDataArray( |
||
30 | $this->getInspector(), |
||
31 | false |
||
32 | ); |
||
33 | |||
34 | $refClass = new \ReflectionClass($errorData["type"]); |
||
35 | $className = $refClass->getShortName(); |
||
36 | |||
37 | $response = array( |
||
38 | 'error' => [ |
||
39 | "type" => $className, |
||
40 | "message" => $errorData["message"] |
||
41 | ] |
||
42 | ); |
||
43 | |||
44 | $this->setProperHeader($this->getException()); |
||
45 | |||
46 | echo json_encode($response, defined('JSON_PARTIAL_OUTPUT_ON_ERROR') ? JSON_PARTIAL_OUTPUT_ON_ERROR : 0); |
||
47 | |||
48 | return Handler::QUIT; |
||
49 | } |
||
51 |