MonitorExceptionHandler::report()   A
last analyzed

Complexity

Conditions 4
Paths 5

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 14
rs 9.2
cc 4
eloc 7
nc 5
nop 1
1
<?php
2
3
namespace Adriandmitroca\LaravelExceptionMonitor;
4
5
use Exception;
6
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
7
use Illuminate\Http\Request;
8
9
class MonitorExceptionHandler extends ExceptionHandler
10
{
11
    
12
    /**
13
     * Report or log an exception.
14
     *
15
     * @param  \Exception $e
16
     *
17
     */
18
    public function report(Exception $e)
19
    {
20
        foreach ($this->dontReport as $type) {
21
            if ($e instanceof $type) {
22
                return parent::report($e);
23
            }
24
        }
25
26
        if (app()->bound('exception-monitor')) {
27
            app('exception-monitor')->notifyException($e);
28
        }
29
30
        return parent::report($e);
31
    }
32
}