Lines 100.00% 1 / 1
Functions and Methods 100.00% 1 / 1
Classes and Traits 100.00% 1 / 1
Name Lines Functions and Methods CRAP Classes and Traits
MalformedEventException 100.00% 1 / 1 100.00% 1 / 1 1 100.00% 1 / 1
 __construct 100.00% 1 / 1 100.00% 1 / 1 1
1<?php
2
3declare(strict_types=1);
4
5namespace Lorekeeper\Server\Exception;
6
7use Lorekeeper\Server\Event\Event;
8use RuntimeException;
9use Throwable;
10
11final class MalformedEventException extends RuntimeException
12{
13    /** @param class-string<Event> $event */
14    public function __construct(
15        public readonly string $event,
16        string $reason,
17        ?Throwable $previous = null,
18    ) {
19        parent::__construct("Malformed {$event}: {$reason}", previous: $previous);
20    }
21}