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

Handler::setInspector()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

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