| Total Complexity | 8 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | class TimeUnit |
||
| 6 | { |
||
| 7 | public const DAYS = 'days'; |
||
| 8 | public const HOURS = 'hours'; |
||
| 9 | public const MICROSECONDS = 'microseconds'; |
||
| 10 | public const MILLISECONDS = 'milliseconds'; |
||
| 11 | public const MINUTES = 'minutes'; |
||
| 12 | public const NANOSECONDS = 'nanoseconds'; |
||
| 13 | public const SECONDS = 'seconds'; |
||
| 14 | |||
| 15 | public static function toNanos(int $duration, string $units): int |
||
| 40 |
For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example: