Total Complexity | 2 |
Total Lines | 13 |
Duplicated Lines | 0 % |
Coverage | 42.86% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
13 | final class MetadataEnricherList extends TypedList |
||
14 | { |
||
15 | 3 | public function __construct(iterable $enrichers = []) |
|
16 | { |
||
17 | 3 | $this->init($enrichers, [MetadataEnricherInterface::class]); |
|
18 | 3 | } |
|
19 | |||
20 | 1 | public function prependEnricher(string $key, string $value): self |
|
21 | { |
||
22 | 1 | return $this->unshift( |
|
23 | 1 | new CallbackMetadataEnricher( |
|
24 | 1 | fn(MetadataInterface $metadata): MetadataInterface => $metadata->with($key, $value) |
|
|
|||
25 | 1 | ) |
|
26 | ); |
||
29 |