1 | <?php |
||
10 | final class Exception implements JsonSerializable |
||
11 | { |
||
12 | /** |
||
13 | * @var string|int|null |
||
14 | */ |
||
15 | private $code; |
||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | private $message; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | private $module; |
||
26 | |||
27 | /** |
||
28 | * @var mixed[] |
||
29 | */ |
||
30 | private $attributeList = []; |
||
31 | |||
32 | /** |
||
33 | * @var StackTraceFrame[] |
||
34 | */ |
||
35 | private $stackTraceFrameList = []; |
||
36 | |||
37 | /** |
||
38 | * @var string|null |
||
39 | */ |
||
40 | private $type; |
||
41 | |||
42 | /** |
||
43 | * @var bool|null |
||
44 | */ |
||
45 | private $isHandled; |
||
46 | |||
47 | 18 | public function __construct(string $message) |
|
51 | |||
52 | /** |
||
53 | * @param string|int $code |
||
54 | */ |
||
55 | 14 | public function withCode($code): self |
|
62 | |||
63 | 1 | public function inModule(string $module): self |
|
70 | |||
71 | /** |
||
72 | * @param mixed $value |
||
73 | */ |
||
74 | 1 | public function withAttribute(string $name, $value): self |
|
81 | |||
82 | 14 | public function withStackTraceFrame(StackTraceFrame ...$frame): self |
|
89 | |||
90 | 14 | public function asType(string $type): self |
|
97 | |||
98 | 1 | public function thatIsHandled(): self |
|
105 | |||
106 | 1 | public function thatIsNotHandled(): self |
|
113 | |||
114 | /** |
||
115 | * @return mixed[] |
||
116 | */ |
||
117 | 17 | public function jsonSerialize(): array |
|
129 | } |
||
130 |