Total Complexity | 3 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
12 | #[AsService] |
||
13 | class ExceptionFormatterLocator implements ExceptionFormatterLocatorInterface |
||
14 | { |
||
15 | /** @var HashMap<string, callable|Formatter> */ |
||
16 | private readonly HashMap $formatters; |
||
17 | |||
18 | 6 | public function __construct( |
|
19 | #[TaggedIterator(Formatter::class, defaultIndexMethod: 'getExceptionClass', defaultPriorityMethod: 'getPriority')] |
||
20 | iterable $formatters, |
||
21 | ) { |
||
22 | 6 | $this->formatters = HashMap::collect($formatters); |
|
|
|||
23 | } |
||
24 | |||
25 | 6 | public function get(\Throwable $e): Formatter|callable |
|
30 | ; |
||
31 | } |
||
32 | |||
33 | 3 | public function has(\Throwable $e): bool |
|
38 |