Handler   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 10
c 2
b 0
f 0
dl 0
loc 25
ccs 0
cts 0
cp 0
rs 10
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A render() 0 5 1
A report() 0 7 3
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