* Parent Exception related to the API, able to generate a valid Response (ResponseInterface).
* Also can include various information in debug mode.
*/
-abstract class ApiException extends \Exception {
+abstract class ApiException extends \Exception
+{
/**
* @var Response instance from Slim.
*
* @return Response Final response to give.
*/
- public abstract function getApiResponse();
+ abstract public function getApiResponse();
/**
* Creates ApiResponse body.
*
* @return array|string response body
*/
- protected function getApiResponseBody() {
+ protected function getApiResponseBody()
+ {
if ($this->debug !== true) {
return $this->getMessage();
}
return [
'message' => $this->getMessage(),
- 'stacktrace' => get_class($this) .': '. $this->getTraceAsString()
+ 'stacktrace' => get_class($this) . ': ' . $this->getTraceAsString()
];
}