mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 12:12:18 +00:00
Code cleanup
This commit is contained in:
@@ -158,7 +158,7 @@ class GracefulNotFoundHandler extends ExceptionHandler
|
||||
$accountId = $param->id;
|
||||
}
|
||||
if (!($param instanceof Account) && !is_object($param)) {
|
||||
$accountId = (int)$param;
|
||||
$accountId = (int) $param;
|
||||
}
|
||||
|
||||
/** @var null|Account $account */
|
||||
@@ -188,7 +188,7 @@ class GracefulNotFoundHandler extends ExceptionHandler
|
||||
$user = auth()->user();
|
||||
$route = $request->route();
|
||||
$param = $route->parameter('transactionGroup');
|
||||
$groupId = !is_object($param) ? (int)$param : 0;
|
||||
$groupId = !is_object($param) ? (int) $param : 0;
|
||||
|
||||
/** @var null|TransactionGroup $group */
|
||||
$group = $user->transactionGroups()->withTrashed()->find($groupId);
|
||||
@@ -228,7 +228,7 @@ class GracefulNotFoundHandler extends ExceptionHandler
|
||||
$user = auth()->user();
|
||||
$route = $request->route();
|
||||
$param = $route->parameter('attachment');
|
||||
$attachmentId = is_object($param) ? 0 : (int)$param;
|
||||
$attachmentId = is_object($param) ? 0 : (int) $param;
|
||||
|
||||
/** @var null|Attachment $attachment */
|
||||
$attachment = $user->attachments()->withTrashed()->find($attachmentId);
|
||||
|
@@ -157,7 +157,7 @@ class Handler extends ExceptionHandler
|
||||
$errorCode = 500;
|
||||
$errorCode = $e instanceof MethodNotAllowedHttpException ? 405 : $errorCode;
|
||||
|
||||
$isDebug = (bool)config('app.debug', false);
|
||||
$isDebug = (bool) config('app.debug', false);
|
||||
if ($isDebug) {
|
||||
app('log')->debug(sprintf('Return JSON %s with debug.', get_class($e)));
|
||||
|
||||
@@ -214,7 +214,7 @@ class Handler extends ExceptionHandler
|
||||
*/
|
||||
public function report(\Throwable $e): void
|
||||
{
|
||||
$doMailError = (bool)config('firefly.send_error_message');
|
||||
$doMailError = (bool) config('firefly.send_error_message');
|
||||
if ($this->shouldntReportLocal($e) || !$doMailError) {
|
||||
parent::report($e);
|
||||
|
||||
@@ -250,7 +250,7 @@ class Handler extends ExceptionHandler
|
||||
|
||||
// create job that will mail.
|
||||
$ipAddress = request()->ip() ?? '0.0.0.0';
|
||||
$job = new MailError($userData, (string)config('firefly.site_owner'), $ipAddress, $data);
|
||||
$job = new MailError($userData, (string) config('firefly.site_owner'), $ipAddress, $data);
|
||||
dispatch($job);
|
||||
|
||||
parent::report($e);
|
||||
|
Reference in New Issue
Block a user