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 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace Stewart\Sun; | |
| 6 | ||
| 7 | use DateTimeImmutable; | |
| 8 | use Stewart\Contracts\Exception\SunError; | |
| 9 | use Stewart\Contracts\Exception\SunException; | |
| 10 | use Stewart\Contracts\Sun\GeoLocation; | |
| 11 | use Stewart\Contracts\Sun\SunCalendar; | |
| 12 | use Stewart\Contracts\Sun\SunDay; | |
| 13 | use Stewart\Contracts\Sun\SunEvent; | |
| 14 | use Stewart\Contracts\Sun\SunPosition; | |
| 15 | use Stewart\Contracts\Time\Instant; | |
| 16 | use Stewart\Contracts\Time\SunOffset; | |
| 17 | ||
| 18 | final 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 | } |