| Total Complexity | 4 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | #[AutoconfigureTag(MapperInterface::class)] |
||
| 12 | class ArrayMapper implements MapperInterface |
||
| 13 | { |
||
| 14 | 1 | public function __invoke(string $typeName, array $value, array $parameters = []): array |
|
| 15 | { |
||
| 16 | 1 | return HashMap::collect($parameters[key($value)] ?? []) |
|
| 17 | 1 | ->map(static fn (Entry $paramEntry) => $value[$paramEntry->key]) |
|
| 18 | 1 | ->map(fn (Entry $paramEntry) => ($this)($paramEntry->value, $parameters[key($value)][$paramEntry->key] ?? [])) |
|
| 19 | 1 | ->toAssocArray() |
|
| 20 | 1 | ->get() |
|
| 21 | ; |
||
| 22 | } |
||
| 23 | |||
| 24 | 19 | public function canMap(string $typeName, mixed $value = null): bool |
|
| 27 | } |
||
| 28 | |||
| 29 | 1 | public static function getPriority(): int |
|
| 34 |