Handler::report()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 3
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 7
ccs 0
cts 0
cp 0
crap 12
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Exceptions;
6
7
use App\Http\Header;
8
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
9
use Throwable;
10
11
final class Handler extends ExceptionHandler
12
{
13
    protected $dontReport = [
14
        //
15
    ];
16
17
    protected $dontFlash = [
18
        'password',
19
        'password_confirmation',
20
    ];
21
22
    public function report(Throwable $e)
23
    {
24
        if ($this->container->bound('sentry') && $this->shouldReport($e)) {
25
            $this->container->make('sentry')->captureException($e);
26
        }
27
28
        parent::report($e);
29
    }
30
31
    public function render($request, Throwable $e)
32
    {
33
        $request->headers->set(Header::ACCEPT, 'application/json');
34
35
        return parent::render($request, $e);
36
    }
37
}
38