Upgrade to 7.4

This commit is contained in:
James Cole
2020-06-06 22:25:52 +02:00
parent 6cc4d14fcb
commit 8643034945
15 changed files with 766 additions and 388 deletions

View File

@@ -38,6 +38,7 @@ use Illuminate\Http\Request;
use Illuminate\Routing\Redirector;
use Log;
use Symfony\Component\HttpFoundation\Response;
use Throwable;
/**
* Class GracefulNotFoundHandler
@@ -53,7 +54,7 @@ class GracefulNotFoundHandler extends ExceptionHandler
* @throws Exception
* @return mixed
*/
public function render($request, Exception $exception)
public function render($request, Throwable $exception)
{
$route = $request->route();
if (null === $route) {
@@ -136,12 +137,12 @@ class GracefulNotFoundHandler extends ExceptionHandler
/**
* @param Request $request
* @param Exception $exception
* @param Throwable $exception
*
* @throws Exception
* @return Redirector|Response
*/
private function handleAccount(Request $request, Exception $exception)
private function handleAccount(Request $request, Throwable $exception)
{
Log::debug('404 page is probably a deleted account. Redirect to overview of account types.');
/** @var User $user */
@@ -164,12 +165,12 @@ class GracefulNotFoundHandler extends ExceptionHandler
/**
* @param Request $request
* @param Exception $exception
* @param Throwable $exception
*
* @throws Exception
* @return RedirectResponse|Redirector|Response
*/
private function handleAttachment(Request $request, Exception $exception)
private function handleAttachment(Request $request, Throwable $exception)
{
Log::debug('404 page is probably a deleted attachment. Redirect to parent object.');
/** @var User $user */
@@ -208,13 +209,13 @@ class GracefulNotFoundHandler extends ExceptionHandler
}
/**
* @param Request $request
* @param Throwable $request
* @param Exception $exception
*
* @throws Exception
* @return RedirectResponse|\Illuminate\Http\Response|Redirector|Response
*/
private function handleGroup(Request $request, Exception $exception)
private function handleGroup(Request $request, Throwable $exception)
{
Log::debug('404 page is probably a deleted group. Redirect to overview of group types.');
/** @var User $user */

View File

@@ -33,9 +33,9 @@ use Illuminate\Auth\AuthenticationException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Illuminate\Validation\ValidationException as LaravelValidationException;
use League\OAuth2\Server\Exception\OAuthServerException;
use Request;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Illuminate\Http\Request;
use Throwable;
/**
* Class Handler
*
@@ -51,7 +51,7 @@ class Handler extends ExceptionHandler
*
* @return mixed
*/
public function render($request, Exception $exception)
public function render($request, Throwable $exception)
{
if ($exception instanceof LaravelValidationException && $request->expectsJson()) {
// ignore it: controller will handle it.
@@ -119,7 +119,7 @@ class Handler extends ExceptionHandler
*
* @return void
*/
public function report(Exception $exception)
public function report(Throwable $exception)
{
$doMailError = config('firefly.send_error_message');
// if the user wants us to mail:
@@ -143,13 +143,13 @@ class Handler extends ExceptionHandler
'line' => $exception->getLine(),
'code' => $exception->getCode(),
'version' => config('firefly.version'),
'url' => Request::fullUrl(),
'userAgent' => Request::userAgent(),
'json' => Request::acceptsJson(),
'url' => request()->fullUrl(),
'userAgent' => request()->userAgent(),
'json' => request()->acceptsJson(),
];
// create job that will mail.
$ipAddress = Request::ip() ?? '0.0.0.0';
$ipAddress = request()->ip() ?? '0.0.0.0';
$job = new MailError($userData, (string) config('firefly.site_owner'), $ipAddress, $data);
dispatch($job);
}