X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2Fapi%2Fexceptions%2FApiException.php;h=7deafb961fc33af72f9b470c7b082e424a61e40d;hb=53054b2bf6a919fd4ff9b44b6ad1986f21f488b6;hp=c8490e0cb2e032f3a48ec29e1c6b4b8efd3dfaff;hpb=80677a23e2e10d78bc527e9754286787b453ce61;p=github%2Fshaarli%2FShaarli.git diff --git a/application/api/exceptions/ApiException.php b/application/api/exceptions/ApiException.php index c8490e0c..7deafb96 100644 --- a/application/api/exceptions/ApiException.php +++ b/application/api/exceptions/ApiException.php @@ -10,7 +10,8 @@ use Slim\Http\Response; * 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. @@ -27,7 +28,7 @@ abstract class ApiException extends \Exception { * * @return Response Final response to give. */ - public abstract function getApiResponse(); + abstract public function getApiResponse(); /** * Creates ApiResponse body. @@ -36,13 +37,14 @@ abstract class ApiException extends \Exception { * * @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() ]; }