| Conditions | 4 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | protected function timestamp($timestamp) |
||
| 29 | { |
||
| 30 | switch (true) { |
||
| 31 | case $timestamp instanceof \DateTime: |
||
| 32 | return $timestamp->getTimestamp() * 1000; |
||
| 33 | case is_numeric($timestamp) && strlen((string)$timestamp) == 10: |
||
| 34 | return $timestamp * 1000; |
||
| 35 | default: |
||
| 36 | return $timestamp; |
||
| 37 | } |
||
| 38 | } |
||
| 39 | } |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.