| Total Complexity | 8 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | class DateInterval |
||
| 17 | { |
||
| 18 | private $interval; |
||
| 19 | |||
| 20 | public function __construct(string $interval) |
||
| 27 | } |
||
| 28 | |||
| 29 | public function format(string $format) : string |
||
| 30 | { |
||
| 31 | $format = preg_replace('/(?<!%)(%H|%h|%I|%i|%S|%s|%F|%f)/', '%$1', $format); |
||
| 32 | |||
| 33 | return $this->interval->format($format); |
||
| 34 | } |
||
| 35 | |||
| 36 | public function getDateTimeInterval() : DateTimeInterval |
||
| 39 | } |
||
| 40 | |||
| 41 | public static function fromDateTimeInterval(DateTimeInterval $interval) : DateInterval |
||
| 60 | } |
||
| 61 | } |
||
| 62 |