AirbrakeHandler   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 19
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A handle() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SKM\Whoops\Handler;
6
7
use Airbrake\Notifier;
8
use Whoops\Handler\Handler;
9
10
/**
11
 * @author Márk Sági-Kazár <[email protected]>
12
 */
13
final class AirbrakeHandler extends Handler
14
{
15
    /**
16
     * @var Notifier
17
     */
18
    private $notifier;
19
20 2
    public function __construct(Notifier $notifier)
21
    {
22 2
        $this->notifier = $notifier;
23 2
    }
24
25 1
    public function handle(): int
26
    {
27 1
        $this->notifier->notify($this->getException());
28
29 1
        return Handler::DONE;
30
    }
31
}
32