Conditions | 4 |
Paths | 4 |
Total Lines | 19 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
21 | 5 | public function __construct(OutboxMappedSuperclass $outboxMappedSuperclass, array $conversionMap) |
|
22 | { |
||
23 | 5 | $this->outboxMappedSuperclass = $outboxMappedSuperclass; |
|
24 | |||
25 | 5 | foreach ($conversionMap as $domainEvent => $converter) { |
|
26 | 5 | if (! class_exists($domainEvent)) { |
|
27 | 1 | throw new InvalidArgumentException( |
|
28 | 1 | sprintf('Domain Event \"%s\" does not exist', $domainEvent) |
|
29 | ); |
||
30 | } |
||
31 | |||
32 | 4 | if (! $converter instanceof Converter) { |
|
33 | 1 | throw new InvalidArgumentException( |
|
34 | 4 | sprintf('%s class must implements Converter interface', get_class($converter)) |
|
35 | ); |
||
36 | } |
||
37 | } |
||
38 | |||
39 | 3 | $this->conversionMap = $conversionMap; |
|
40 | 3 | } |
|
64 |