• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

heiglandreas / holidayChecker / 13304001520

13 Feb 2025 09:00AM UTC coverage: 95.972% (-0.4%) from 96.394%
13304001520

push

github

web-flow
Merge pull request #175 from heiglandreas/updatePHPUnit

Update tests so they run with any PHPUnit version

405 of 422 relevant lines covered (95.97%)

11.75 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.12
/src/Factory/DateFollowupFactory.php
1
<?php
2

3
/**
4
 * Copyright Andreas Heigl <andreas@heigl.org>
5
 *
6
 * Licenses under the MIT-license. For details see the included file LICENSE.md
7
 */
8

9
declare(strict_types=1);
10

11
namespace Org_Heigl\Holidaychecker\Factory;
12

13
use DOMElement;
14
use Org_Heigl\Holidaychecker\CalendarDayFactory;
15
use Org_Heigl\Holidaychecker\HolidayIteratorItemInterface;
16
use Org_Heigl\Holidaychecker\IteratorItem\DateFollowUp;
17
use function explode;
18

19
class DateFollowupFactory implements ItemFromDomElementCreator
20
{
21
        public function itemFromDomElement(DOMElement $element): ?HolidayIteratorItemInterface
22
        {
23
                if ($element->nodeName !== 'dateFollowUp') {
3✔
24
                        return null;
3✔
25
                }
26

27
                $day = CalendarDayFactory::createCalendarDay(
2✔
28
                        (int) $element->getAttribute('day'),
2✔
29
                        (int) $element->getAttribute('month'),
2✔
30
                        ($element->hasAttribute('calendar') ? $element->getAttribute('calendar') : 'gregorian')
2✔
31
                );
2✔
32

33
                $replaced = [];
2✔
34
                if ($element->hasAttribute('replaced')) {
2✔
35
                        /** @var array<"sunday"|"monday"|"tuesday"|"wednesday"|"thursday"|"friday"|"saturday"> $replaced */
36
                        $replaced = explode(' ', $element->getAttribute('replaced'));
×
37
                }
38

39
                return new DateFollowUp(
2✔
40
                        $element->textContent,
2✔
41
                        $element->getAttribute('free') === "true",
2✔
42
                        $day,
2✔
43
                        $element->getAttribute('followup'),
2✔
44
                        $replaced
2✔
45
                );
2✔
46
        }
47
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc