Conditions | 4 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | public function itemFromDomElement(DOMElement $element): ?HolidayIteratorItemInterface |
||
22 | { |
||
23 | if ($element->nodeName !== 'dateFollowUp') { |
||
24 | return null; |
||
25 | } |
||
26 | |||
27 | $day = CalendarDayFactory::createCalendarDay( |
||
28 | (int) $element->getAttribute('day'), |
||
29 | (int) $element->getAttribute('month'), |
||
30 | ($element->hasAttribute('calendar') ? $element->getAttribute('calendar') : 'gregorian') |
||
31 | ); |
||
32 | |||
33 | return new DateFollowUp( |
||
34 | $element->textContent, |
||
35 | $element->getAttribute('free') === "true", |
||
36 | $day, |
||
37 | $element->getAttribute('followup'), |
||
38 | ($element->hasAttribute('replaced') ? explode(' ', $element->getAttribute('replaced')) : []) |
||
39 | ); |
||
42 |