Total Complexity | 14 |
Total Lines | 63 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
10 | trait DoesProcessException |
||
11 | { |
||
12 | /** @var bool */ |
||
13 | protected $throwOnError = true; |
||
14 | |||
15 | /** @return self */ |
||
16 | 1 | public function doNotThrowOnError(): self |
|
20 | } |
||
21 | |||
22 | /** @return self */ |
||
23 | 1 | public function throwOnError(): self |
|
27 | } |
||
28 | |||
29 | /** @return bool */ |
||
30 | 2 | public function doesThrowsOnError(): bool |
|
33 | } |
||
34 | |||
35 | /** |
||
36 | * @param \Throwable $e |
||
37 | * @throws \Throwable |
||
38 | */ |
||
39 | 2 | protected function processException(\Throwable $e): void |
|
45 | 1 | } |
|
46 | |||
47 | /** |
||
48 | * @param \Throwable $e |
||
49 | */ |
||
50 | 1 | protected function debugException(\Throwable $e): void |
|
51 | { |
||
52 | 1 | if (\defined('APP_DEBUG') && APP_DEBUG) { |
|
53 | 1 | if (\defined('DEBUG_DUMP_EXCEPTION') && DEBUG_DUMP_EXCEPTION) { |
|
54 | 1 | $exceptionMessage = '[' . \get_class($e) . '] ' . $e->getMessage(); |
|
55 | 1 | $this->dump($exceptionMessage, $e->getTraceAsString()); |
|
56 | } |
||
57 | 1 | if (\defined('DEBUG_DUMP_EXCEPTION_CLASS') && DEBUG_DUMP_EXCEPTION_CLASS) { |
|
58 | 1 | $this->dump($e); |
|
59 | } |
||
60 | } |
||
61 | 1 | } |
|
62 | |||
63 | /** |
||
64 | * @param mixed ...$that |
||
65 | */ |
||
66 | 1 | protected function dump(...$that): void |
|
73 | // @codeCoverageIgnoreEnd |
||
74 | } |
||
77 |