| Conditions | 3 |
| Paths | 4 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 5 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 15 | function format(string $formatter, mixed ...$items): mixed |
||
| 16 | { |
||
| 17 | 75 | $items = FormatterService::unwrapIfArray($items); |
|
| 18 | |||
| 19 | 75 | $formatter = class_exists($formatter) || interface_exists($formatter) |
|
| 20 | 53 | ? call($formatter, $items) |
|
| 21 | 24 | : call($formatter . FormatterService::BINDING_POSTFIX, $items); |
|
| 22 | |||
| 23 | 73 | FormatterService::ensureFormatterImplementsInterface( |
|
| 24 | 73 | $formatter->getInternal(Call::INSTANCE) |
|
| 25 | 73 | ); |
|
| 26 | |||
| 27 | 71 | return $formatter->format(); |
|
| 28 | } |
||
| 30 |