5843f6b6a9efa481c2df6b4088a695ef7e70a334
[GitHub/WoltLab/WCF.git] /
1 <?php
2
3 declare(strict_types=1);
4
5 namespace CuyZ\Valinor\Type\Parser\Exception\Enum;
6
7 use CuyZ\Valinor\Type\Parser\Exception\InvalidType;
8 use RuntimeException;
9 use UnitEnum;
10
11 /** @internal */
12 final class MissingEnumColon extends RuntimeException implements InvalidType
13 {
14 /**
15 * @param class-string<UnitEnum> $enumName
16 */
17 public function __construct(string $enumName, string $case)
18 {
19 if ($case === ':') {
20 $case = '?';
21 }
22
23 parent::__construct(
24 "Missing second colon symbol for enum `$enumName::$case`.",
25 1653468435
26 );
27 }
28 }