Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php namespace rtens\domin\delivery\cli\fields; |
||
30 | public function inflate(Parameter $parameter, $serialized) { |
||
31 | if (!$serialized) { |
||
32 | return null; |
||
33 | } |
||
34 | |||
35 | $days = 0; |
||
36 | if (strpos($serialized, ' ')) { |
||
37 | list($days, $serialized) = explode(' ', $serialized); |
||
38 | } |
||
39 | list($hours, $minutes) = explode(':', $serialized); |
||
40 | |||
41 | $days = intval(rtrim($days, "d")); |
||
42 | $hours = intval($hours); |
||
43 | $minutes = intval($minutes); |
||
44 | |||
45 | return new \DateInterval("P{$days}DT{$hours}H{$minutes}M"); |
||
46 | } |
||
47 | } |