Conditions | 4 |
Paths | 1 |
Total Lines | 16 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | public function parseDateRange(ListInterface $datePartsList, DateTime $from, DateTime $to, string $delimiter): string |
||
20 | { |
||
21 | return $datePartsList->mapNotNull(function (Pair $pair) use ($from, $to, $delimiter) { |
||
22 | $key = $pair->getKey(); |
||
23 | $datePart = $pair->getValue(); |
||
24 | if (strpos($key, "year") !== false) { |
||
|
|||
25 | return $datePart->render($from, $this->parentDateObject); |
||
26 | } |
||
27 | if (strpos($key, "month") !== false) { |
||
28 | return $datePart->render($from, $this->parentDateObject); |
||
29 | } |
||
30 | if (strpos($key, "day")) { |
||
31 | return $this->renderOneRangePart($datePart, $from, $to, $delimiter); |
||
32 | } |
||
33 | return null; |
||
34 | })->joinToString(""); |
||
35 | } |
||
37 |