Total Complexity | 8 |
Total Lines | 59 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | class ExceptionContext extends AbstractProfileContext |
||
15 | { |
||
16 | /** @var \Exception */ |
||
17 | protected $exception; |
||
18 | |||
19 | /** @var ExceptionContext|null */ |
||
20 | protected $nextExceptionContext; |
||
21 | |||
22 | public function __construct(\Exception $exception = null) |
||
23 | { |
||
24 | $this->exception = $exception; |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * @return \Exception |
||
29 | */ |
||
30 | public function getException() |
||
31 | { |
||
32 | return $this->exception; |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * @return \Exception|null |
||
37 | */ |
||
38 | public function getLastException() |
||
39 | { |
||
40 | if (null == $this->nextExceptionContext) { |
||
41 | return $this->exception; |
||
42 | } |
||
43 | |||
44 | return $this->nextExceptionContext->getException(); |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * @return ExceptionContext|null |
||
49 | */ |
||
50 | public function getNextExceptionContext() |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * @return ExceptionContext |
||
57 | */ |
||
58 | public function addException(\Exception $exception) |
||
75 |