Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| ValueObjectToAutoIncrementTable | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| convert | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | namespace Apie\StorageMetadata\Converters; |
| 3 | |
| 4 | use Apie\Core\ValueObjects\Interfaces\ValueObjectInterface; |
| 5 | use Apie\StorageMetadata\Interfaces\AutoIncrementTableInterface; |
| 6 | use Apie\TypeConverter\ConverterInterface; |
| 7 | use Apie\TypeConverter\TypeConverter; |
| 8 | use ReflectionType; |
| 9 | |
| 10 | /** |
| 11 | * @implements ConverterInterface<?ValueObjectInterface, AutoIncrementTableInterface> |
| 12 | */ |
| 13 | class ValueObjectToAutoIncrementTable implements ConverterInterface |
| 14 | { |
| 15 | public function convert(?ValueObjectInterface $input, ?ReflectionType $wantedType, ?TypeConverter $typeConverter = null): AutoIncrementTableInterface |
| 16 | { |
| 17 | assert($typeConverter !== null); |
| 18 | $input = $input->toNative(); |
| 19 | return $typeConverter->convertTo($input, $wantedType); |
| 20 | } |
| 21 | } |