| Total Complexity | 6 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Coverage | 57.89% |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class StuTime |
||
| 11 | { |
||
| 12 | public const STU_YEARS_IN_FUTURE_OFFSET = 370; |
||
| 13 | |||
| 14 | public function time(): int |
||
| 17 | } |
||
| 18 | |||
| 19 | public function hrtime(): int |
||
| 20 | { |
||
| 21 | return hrtime(true); |
||
| 22 | } |
||
| 23 | |||
| 24 | public function date(string $format): string |
||
| 25 | { |
||
| 26 | return date($format); |
||
| 27 | } |
||
| 28 | |||
| 29 | public function dateTime(): DateTime |
||
| 30 | { |
||
| 31 | return new DateTime(); |
||
| 32 | } |
||
| 33 | |||
| 34 | 2 | public function transformToStuDate(int $unixTimestamp): string |
|
| 35 | { |
||
| 36 | 2 | return sprintf( |
|
| 37 | 2 | '%s%s', |
|
| 38 | 2 | date('d.m.', $unixTimestamp), |
|
| 39 | 2 | (int)date("Y", $unixTimestamp) + StuTime::STU_YEARS_IN_FUTURE_OFFSET, |
|
| 40 | 2 | ); |
|
| 41 | } |
||
| 42 | |||
| 43 | 1 | public function transformToStuDateTime(int $unixTimestamp): string |
|
| 49 | 1 | ); |
|
| 50 | } |
||
| 51 | } |
||
| 52 |