Completed
Pull Request — v1 (#422)
by
unknown
03:17
created

Handler   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 74
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

6 Methods

Rating   Name   Duplication   Size   Complexity  
A setRun() 0 4 1
A getRun() 0 4 1
A setInspector() 0 4 1
A getInspector() 0 4 1
A setException() 0 4 1
A getException() 0 4 1
1
<?php
2
/**
3
 * Whoops - php errors for cool kids
4
 * @author Filipe Dobreira <http://github.com/filp>
5
 */
6
7
namespace Whoops\Handler;
8
9
use Whoops\Exception\Inspector;
10
use Whoops\Run;
11
12
/**
13
 * Abstract implementation of a Handler.
14
 */
15
abstract class Handler implements HandlerInterface
16
{
17
    /**
18
     * Return constants that can be returned from Handler::handle
19
     * to message the handler walker.
20
     */
21
    const DONE         = 0x10; // returning this is optional, only exists for
22
                               // semantic purposes
23
    const LAST_HANDLER = 0x20;
24
    const QUIT         = 0x30;
25
26
    /**
27
     * @var Run
28
     */
29
    private $run;
30
31
    /**
32
     * @var Inspector $inspector
33
     */
34
    private $inspector;
35
36
    /**
37
     * @var \Exception | \Throwable $exception
38
     */
39
    private $exception;
40
41
    /**
42
     * @param Run $run
43
     */
44 2
    public function setRun(Run $run)
45
    {
46 2
        $this->run = $run;
47 2
    }
48
49
    /**
50
     * @return Run
51
     */
52 1
    protected function getRun()
53
    {
54 1
        return $this->run;
55
    }
56
57
    /**
58
     * @param Inspector $inspector
59
     */
60 2
    public function setInspector(Inspector $inspector)
61
    {
62 2
        $this->inspector = $inspector;
63 2
    }
64
65
    /**
66
     * @return Inspector
67
     */
68 2
    protected function getInspector()
69
    {
70 2
        return $this->inspector;
71
    }
72
73
    /**
74
     * @param \Exception | \Throwable $exception
75
     */
76 2
    public function setException($exception)
77
    {
78 2
        $this->exception = $exception;
79 2
    }
80
81
    /**
82
     * @return \Exception | \Throwable
83
     */
84 2
    protected function getException()
85
    {
86 2
        return $this->exception;
87
    }
88
}
89