Total Complexity | 5 |
Total Lines | 17 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class SimpleConverter implements Converter |
||
10 | { |
||
11 | 4 | public function __construct( |
|
12 | protected ?string $entityClass = null |
||
13 | ) { |
||
14 | 4 | if ($entityClass && !is_a($entityClass, ExternalEntity::class, true)) { |
|
15 | 1 | throw new InvalidArgumentException("External Entity has wrong class [{$entityClass}]."); |
|
16 | } |
||
17 | 3 | } |
|
18 | |||
19 | 3 | public function convert($data): ?ExternalEntity |
|
26 | } |
||
27 | } |
||
28 |