Conditions | 5 |
Paths | 5 |
Total Lines | 10 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 1 | Features | 2 |
1 | <?php |
||
30 | public function convertToDatabaseValue($timestamp) |
||
31 | { |
||
32 | if (extension_loaded('mongo')) { |
||
33 | return (null !== $timestamp) ? $timestamp->asMongoDate() : null; |
||
34 | } elseif (extension_loaded('mongodb')) { |
||
35 | return (null !== $timestamp) ? $timestamp->asMongodbUTCDateTime() : null; |
||
36 | } else { |
||
37 | throw new \RuntimeException('Missing MongoDB extension'); |
||
38 | } |
||
39 | } |
||
40 | |||
63 |