Lines
87.50%
7 / 8
Methods
80.00%
4 / 5
Classes
0.00%
0 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| channel | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| phrase | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| summary | 0.00% | 0 / 1 | 0.00% | 0 / 1 | 2 | ||
| [Lorekeeper\Server\Event\NoticeEvent] __construct | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| [Lorekeeper\Server\Event\NoticeEvent] from | 100.00% | 4 / 4 | 100.00% | 1 / 1 | 1 | ||
| 9 | final readonly class AwayFromKeyboardEvent extends NoticeEvent | |
| 10 | { | |
| 11 | #[Override] | |
| 12 | protected static function channel(): string | |
| 13 | { | |
| 14 | return 'server'; | |
| 15 | } | |
| 16 | ||
| 17 | #[Override] | |
| 18 | protected static function phrase(): string | |
| 19 | { | |
| 20 | return 'away from keyboard'; | |
| 21 | } | |
| 22 | ||
| 23 | #[Override] | |
| 24 | public function summary(): string | |
| 25 | { | |
| 26 | return 'Away from keyboard'; | |
| 27 | } | |
| 28 | } |
Inherited from Lorekeeper\Server\Event\NoticeEvent
| 15 | final public function __construct() {} |
| 23 | final public static function from(Message $message): Option\Option | |
| 24 | { | |
| 25 | return Notice::text($message, static::channel())->filter(static fn(string $text): bool => str_contains( | |
| 26 | strtolower($text), | |
| 27 | static::phrase(), | |
| 28 | ))->map(static fn(): static => new static()); | |
| 29 | } |