AirbrakeHandler::handle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
crap 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