Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
9 / 9 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| GeneralServiceFactoryWithDataCollector | |
100.00% |
9 / 9 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| createContextBuilderFactory | |
100.00% |
8 / 8 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace Apie\ApieBundle\DataCollector; |
| 4 | |
| 5 | use Apie\Common\Wrappers\GeneralServiceFactory; |
| 6 | use Apie\Core\BoundedContext\BoundedContextHashmap; |
| 7 | use Apie\Core\ContextBuilders\ContextBuilderFactory; |
| 8 | use Apie\Core\ContextBuilders\ContextBuilderInterface; |
| 9 | use Apie\Serializer\DecoderHashmap; |
| 10 | |
| 11 | class GeneralServiceFactoryWithDataCollector |
| 12 | { |
| 13 | public function __construct(private readonly ApieDataCollector $apieDataCollector) |
| 14 | { |
| 15 | } |
| 16 | |
| 17 | /** |
| 18 | * @param iterable<int, ContextBuilderInterface> $contextBuilders |
| 19 | */ |
| 20 | public function createContextBuilderFactory( |
| 21 | BoundedContextHashmap $boundedContextHashmap, |
| 22 | ?DecoderHashmap $decoderHashmap, |
| 23 | iterable $contextBuilders |
| 24 | ): ContextBuilderFactory { |
| 25 | $contextBuilders = $this->apieDataCollector->wrapContextBuilders( |
| 26 | [...$contextBuilders] |
| 27 | ); |
| 28 | return GeneralServiceFactory::createContextBuilderFactory( |
| 29 | $boundedContextHashmap, |
| 30 | $decoderHashmap, |
| 31 | $contextBuilders |
| 32 | ); |
| 33 | } |
| 34 | } |