AfterloadException::addPrev()   A
last analyzed

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
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace kalanis\kw_afterload;
4
5
use Exception;
6
7
8
/**
9
 * Class AfterloadException
10
 * @package kalanis\kw_afterload
11
 * Exceptions thrown during run
12
 * Can and do chain exceptions on-the-fly
13
 */
14
final class AfterloadException extends Exception
15
{
16
    /** @var Exception|null */
17
    protected $prev = null;
18
19 1
    public function addPrev(?Exception $exception = null): self
20
    {
21 1
        $this->prev = $exception;
22 1
        return $this;
23
    }
24
25 1
    public function getPrev(): ?Exception
26
    {
27 1
        return $this->prev;
28
    }
29
}
30