| Conditions | 6 |
| Paths | 7 |
| Total Lines | 26 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | public function expand($values) { |
||
| 14 | $return = []; |
||
| 15 | foreach ($values as $value) { |
||
| 16 | // Allow date ranges properties to be specified either explicitly, |
||
| 17 | // or implicitly by array position. |
||
| 18 | if (!isset($value['value']) && isset($value[0])) { |
||
| 19 | $value['value'] = $value[0]; |
||
| 20 | } |
||
| 21 | if (!isset($value['end_value'])) { |
||
| 22 | if (isset($value[1])) { |
||
| 23 | $value['end_value'] = $value[1]; |
||
| 24 | } |
||
| 25 | else { |
||
| 26 | // Allow end value to be optional (D#2794481). |
||
| 27 | $value['end_value'] = NULL; |
||
| 28 | } |
||
| 29 | } |
||
| 30 | $start = str_replace(' ', 'T', $value['value']); |
||
| 31 | $end = str_replace(' ', 'T', $value['end_value']); |
||
| 32 | $return[] = [ |
||
| 33 | 'value' => $start, |
||
| 34 | 'end_value' => $end, |
||
| 35 | ]; |
||
| 36 | } |
||
| 37 | return $return; |
||
| 38 | } |
||
| 39 | |||
| 41 |