Lines 0.00% 0 / 6
Methods 0.00% 0 / 1
Classes 0.00% 0 / 1
Name Lines Methods CRAP
 messageTemplate 0.00% 0 / 6 0.00% 0 / 1 42
7enum IdentifierError: string implements ExceptionReason
8{
9    case EntityIdInvalid = 'entity_id_invalid';
10    case AppIdInvalid = 'app_id_invalid';
11    case AppIdTooLong = 'app_id_too_long';
12    case EntityNotGenerated = 'entity_not_generated';
13    case RegistryIdEmpty = 'registry_id_empty';
14
15    public function messageTemplate(): string
16    {
17        return match ($this) {
18            self::EntityIdInvalid => 'Entity ID "{entityId}" is invalid; expected "<domain>.<object_id>" in lowercase letters, digits and "_".',
19            self::AppIdInvalid => 'App ID "{appId}" is invalid; use lowercase letters, digits, "-" and "_", starting with a letter.',
20            self::AppIdTooLong => 'App ID "{appId}" is longer than {limit} characters.',
21            self::EntityNotGenerated => 'Entity ID "{entityId}" is not a generated {domain} entity; run `stewart generate` if it is new.',
22            self::RegistryIdEmpty => '{kind} ID must not be empty.',
23        };
24    }
25}