Lines
100.00%
3 / 3
Functions and Methods
100.00%
1 / 1
Classes and Traits
100.00%
1 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| AwayTracking | 100.00% | 3 / 3 | 100.00% | 1 / 1 | 3 | 100.00% | 1 / 1 | |||
| follow | 100.00% | 3 / 3 | 100.00% | 1 / 1 | 3 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace Lorekeeper\Client\Tracking; | |
| 6 | ||
| 7 | use Lorekeeper\Server\Event\Event; | |
| 8 | use Lorekeeper\Server\Event\Player\PlayerAwayUpdatedEvent; | |
| 9 | ||
| 10 | final readonly class AwayTracking | |
| 11 | { | |
| 12 | /** @mago-expect lint:no-boolean-flag-parameter */ | |
| 13 | public static function follow(bool $away, Event $event, Identity $me): bool | |
| 14 | { | |
| 15 | if ($event instanceof PlayerAwayUpdatedEvent && $me->is($event->name)) { | |
| 16 | return $event->away; | |
| 17 | } | |
| 18 | ||
| 19 | return $away; | |
| 20 | } | |
| 21 | } |