Runner   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 5
c 1
b 0
f 1
lcom 1
cbo 1
dl 0
loc 54
ccs 15
cts 15
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A register() 0 4 1
A handleException() 0 4 1
A addHandler() 0 6 1
A addFormatter() 0 6 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