Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
83.33% |
5 / 6 |
|
50.00% |
1 / 2 |
CRAP | |
0.00% |
0 / 1 |
| ContextBuilderFactory | |
83.33% |
5 / 6 |
|
50.00% |
1 / 2 |
2.02 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| create | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | namespace Apie\Common; |
| 3 | |
| 4 | use Apie\Common\ContextBuilders\BoundedContextProviderContextBuilder; |
| 5 | use Apie\Common\ContextBuilders\RequestBodyDecoderContextBuilder; |
| 6 | use Apie\Core\BoundedContext\BoundedContextHashmap; |
| 7 | use Apie\Core\ContextBuilders\ContextBuilderFactory as ContextBuildersContextBuilderFactory; |
| 8 | use Apie\Core\ContextBuilders\ContextBuilderInterface; |
| 9 | use Apie\Serializer\DecoderHashmap; |
| 10 | |
| 11 | final class ContextBuilderFactory |
| 12 | { |
| 13 | private function __construct() |
| 14 | { |
| 15 | } |
| 16 | public static function create( |
| 17 | BoundedContextHashmap $boundedContextHashmap, |
| 18 | DecoderHashmap $decoderHashmap, |
| 19 | ContextBuilderInterface... $builders |
| 20 | ): ContextBuildersContextBuilderFactory { |
| 21 | return new ContextBuildersContextBuilderFactory( |
| 22 | new BoundedContextProviderContextBuilder($boundedContextHashmap), |
| 23 | new RequestBodyDecoderContextBuilder(new RequestBodyDecoder($decoderHashmap)), |
| 24 | ...$builders |
| 25 | ); |
| 26 | } |
| 27 | } |