Completed
Push — api/develop ( c047b7...f09d4a )
by Bertrand
08:23
created

Handler::handle()   B

Complexity

Conditions 6
Paths 8

Size

Total Lines 24
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 13.776

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 24
ccs 6
cts 15
cp 0.4
rs 8.5125
cc 6
eloc 12
nc 8
nop 1
crap 13.776
1
<?php
2
3
/**
4
 * This file is part of the HRis Software package.
5
 *
6
 * HRis - Human Resource and Payroll System
7
 *
8
 * @link http://github.com/HB-Co/HRis
9
 */
10
namespace HRis\Exceptions;
11
12
use Exception;
13
use Illuminate\Validation\ValidationException;
14
use Illuminate\Auth\Access\AuthorizationException;
15
use Illuminate\Database\Eloquent\ModelNotFoundException;
16
use Symfony\Component\HttpKernel\Exception\HttpException;
17
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
18
19
class Handler extends ExceptionHandler
20
{
21
    /**
22
     * A list of the exception types that should not be reported.
23
     *
24
     * @var array
25
     */
26
    protected $dontReport = [
27
        AuthorizationException::class,
28
        HttpException::class,
29
        ModelNotFoundException::class,
30
        ValidationException::class,
31
    ];
32
33
    /**
34
     * Report or log an exception.
35
     *
36
     * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
37
     *
38
     * @param  \Exception  $e
39
     * @return void
40
     */
41 28
    public function report(Exception $e)
42
    {
43 28
        parent::report($e);
44 28
    }
45
46
    /**
47
     * Render an exception into an HTTP response.
48
     *
49
     * @param  \Illuminate\Http\Request  $request
50
     * @param  \Exception  $e
51
     * @return \Illuminate\Http\Response
52
     */
53
    public function render($request, Exception $e)
54
    {
55
        return parent::render($request, $e);
56
    }
57
}
58