1 | <?php |
||
22 | class ExceptionValueMap |
||
23 | { |
||
24 | /** |
||
25 | * Map of values mapped to exception class |
||
26 | * key => exception class |
||
27 | * value => value associated with exception. |
||
28 | */ |
||
29 | private $map; |
||
30 | |||
31 | /** |
||
32 | * @param array<string,bool>|array<string,int> $map |
||
33 | */ |
||
34 | 43 | public function __construct(array $map) |
|
38 | |||
39 | /** |
||
40 | * Resolves the value corresponding to an exception object. |
||
41 | * |
||
42 | * @return bool|int|false Value found or false is not found |
||
43 | */ |
||
44 | 3 | public function resolveException(\Exception $exception) |
|
48 | |||
49 | /** |
||
50 | * Resolves the value corresponding to an exception object. |
||
51 | * |
||
52 | * @return bool|int|false Value found or false is not found |
||
53 | * |
||
54 | * @internal since 2.8 |
||
55 | */ |
||
56 | 16 | public function resolveThrowable(\Throwable $exception) |
|
60 | |||
61 | /** |
||
62 | * @internal |
||
63 | */ |
||
64 | 11 | public function resolveFromClassName(string $className) |
|
68 | |||
69 | /** |
||
70 | * @return bool|int|false if not found |
||
71 | */ |
||
72 | 27 | private function doResolveClass(string $class) |
|
86 | } |
||
87 |