Clean up some code.

This commit is contained in:
James Cole
2019-06-07 18:13:54 +02:00
parent fba3cb6d90
commit 9c5df6ab6e
16 changed files with 55 additions and 32 deletions

View File

@@ -81,7 +81,7 @@ class Handler extends ExceptionHandler
return response()->json(
[
'message' => $exception->getMessage(),
'exception' => \get_class($exception),
'exception' => get_class($exception),
'line' => $exception->getLine(),
'file' => $exception->getFile(),
'trace' => $exception->getTrace(),
@@ -89,7 +89,7 @@ class Handler extends ExceptionHandler
);
}
return response()->json(['message' => 'Internal Firefly III Exception. See log files.', 'exception' => \get_class($exception)], 500);
return response()->json(['message' => 'Internal Firefly III Exception. See log files.', 'exception' => get_class($exception)], 500);
}
if ($exception instanceof FireflyException || $exception instanceof ErrorException || $exception instanceof OAuthServerException) {
@@ -104,11 +104,11 @@ class Handler extends ExceptionHandler
/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
* This is a great spot to send exceptions to Sentry etc.
*
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's five its fine.
*
* @param \Exception $exception
* @param Exception $exception
*
* @return mixed|void
*
@@ -131,7 +131,7 @@ class Handler extends ExceptionHandler
$userData['email'] = auth()->user()->email;
}
$data = [
'class' => \get_class($exception),
'class' => get_class($exception),
'errorMessage' => $exception->getMessage(),
'time' => date('r'),
'stackTrace' => $exception->getTraceAsString(),

View File

@@ -24,9 +24,11 @@ declare(strict_types=1);
namespace FireflyIII\Exceptions;
use Exception;
/**
* Class NotImplementedException.
*/
class NotImplementedException extends \Exception
class NotImplementedException extends Exception
{
}

View File

@@ -24,9 +24,11 @@ declare(strict_types=1);
namespace FireflyIII\Exceptions;
use Exception;
/**
* Class ValidationExceptions.
*/
class ValidationException extends \Exception
class ValidationException extends Exception
{
}