Runner   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 55
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 55
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 addHandler() 0 6 1
A addFormatter() 0 6 1
A handleException() 0 4 1
1
<?php
2
3
namespace Mosaic\Exceptions\Adapters\Whoops;
4
5
use Mosaic\Exceptions\Runner as RunnerInterface;
6
use Throwable;
7
use Whoops\Run;
8
9
class Runner implements RunnerInterface
10
{
11
    /**
12
     * @var Run
13
     */
14
    private $delegate;
15
16
    /**
17
     * Runner constructor.
18
     * @param Run $delegate
19
     */
20 5
    public function __construct(Run $delegate)
21
    {
22 5
        $this->delegate = $delegate;
23 5
    }
24
25
    /**
26
     * Registers the error handlers
27
     * @return mixed
28
     */
29 2
    public function register()
30
    {
31 2
        $this->delegate->register();
32 2
    }
33
34
    /**
35
     * @param $handler
36
     * @return RunnerInterface
37
     */
38 1
    public function addHandler($handler)
39
    {
40 1
        $this->delegate->pushHandler($handler);
41
42 1
        return $this;
43
    }
44
45
    /**
46
     * @param $formatter
47
     * @return RunnerInterface
48
     */
49 2
    public function addFormatter($formatter)
50
    {
51 2
        $this->delegate->pushHandler($formatter);
52
53 2
        return $this;
54
    }
55
56
    /**
57
     * @param Throwable $e
58
     */
59 1
    public function handleException(Throwable $e)
60
    {
61 1
        $this->delegate->handleException($e);
62 1
    }
63
}
64