Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3.0416 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
41 | 2 | public function convertToDatabaseValue(mixed $value, AbstractPlatform $platform): ?string |
|
42 | { |
||
43 | 2 | if ($value instanceof Money) { |
|
44 | return $value->getAmount(); |
||
45 | } |
||
46 | |||
47 | 2 | if ($value === null) { |
|
48 | 1 | return null; |
|
49 | } |
||
50 | |||
51 | 1 | throw new InvalidArgumentException('Cannot convert to database value: ' . var_export($value, true)); |
|
52 | } |
||
54 |