Lines 100.00% 6 / 6
Functions and Methods 100.00% 6 / 6
Classes and Traits 100.00% 1 / 1
Name Lines Functions and Methods CRAP Classes and Traits
UnlocatedSunCalendar 100.00% 6 / 6 100.00% 6 / 6 6 100.00% 1 / 1
 getLocation 100.00% 1 / 1 100.00% 1 / 1 1
 findNextEvent 100.00% 1 / 1 100.00% 1 / 1 1
 getDayOn 100.00% 1 / 1 100.00% 1 / 1 1
 getPositionAt 100.00% 1 / 1 100.00% 1 / 1 1
 getCurrentPosition 100.00% 1 / 1 100.00% 1 / 1 1
 isSunUp 100.00% 1 / 1 100.00% 1 / 1 1
1<?php
2
3declare(strict_types=1);
4
5namespace Stewart\Sun;
6
7use DateTimeImmutable;
8use Stewart\Contracts\Exception\SunError;
9use Stewart\Contracts\Exception\SunException;
10use Stewart\Contracts\Sun\GeoLocation;
11use Stewart\Contracts\Sun\SunCalendar;
12use Stewart\Contracts\Sun\SunDay;
13use Stewart\Contracts\Sun\SunEvent;
14use Stewart\Contracts\Sun\SunPosition;
15use Stewart\Contracts\Time\Instant;
16use Stewart\Contracts\Time\SunOffset;
17
18final readonly class UnlocatedSunCalendar implements SunCalendar
19{
20    public function getLocation(): GeoLocation
21    {
22        throw SunException::createForReason(SunError::LocationUnknown);
23    }
24
25    public function findNextEvent(SunEvent $event, ?SunOffset $offset = null, ?Instant $after = null): ?Instant
26    {
27        throw SunException::createForReason(SunError::LocationUnknown);
28    }
29
30    public function getDayOn(DateTimeImmutable $day): SunDay
31    {
32        throw SunException::createForReason(SunError::LocationUnknown);
33    }
34
35    public function getPositionAt(Instant $moment): SunPosition
36    {
37        throw SunException::createForReason(SunError::LocationUnknown);
38    }
39
40    public function getCurrentPosition(): SunPosition
41    {
42        throw SunException::createForReason(SunError::LocationUnknown);
43    }
44
45    public function isSunUp(): bool
46    {
47        throw SunException::createForReason(SunError::LocationUnknown);
48    }
49}