Runner::addHandler()   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 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Mosaic\Exceptions\Adapters\Booboo;
4
5
use League\BooBoo\Runner as BooBoo;
6
use Mosaic\Exceptions\Runner as RunnerInterface;
7
use Throwable;
8
9
class Runner implements RunnerInterface
10
{
11
    /**
12
     * @var BooBoo
13
     */
14
    private $delegate;
15
16
    /**
17
     * @param BooBoo $delegate
18
     */
19 5
    public function __construct(BooBoo $delegate)
20
    {
21 5
        $this->delegate = $delegate;
22 5
    }
23
24
    /**
25
     * Registers the error handlers
26
     * @return mixed
27
     */
28 2
    public function register()
29
    {
30 2
        $this->delegate->register();
31 2
    }
32
33
    /**
34
     * @param Throwable $e
35
     */
36 1
    public function handleException(Throwable $e)
37
    {
38 1
        $this->delegate->exceptionHandler($e);
39 1
    }
40
41
    /**
42
     * @param $handler
43
     * @return RunnerInterface
44
     */
45 1
    public function addHandler($handler)
46
    {
47 1
        $this->delegate->pushHandler($handler);
48
49 1
        return $this;
50
    }
51
52
    /**
53
     * @param $formatter
54
     * @return RunnerInterface
55
     */
56 2
    public function addFormatter($formatter)
57
    {
58 2
        $this->delegate->pushFormatter($formatter);
59
60 2
        return $this;
61
    }
62
}
63