blob: 3f6ed43aea8a5383bc75d440260d20b61afec637 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
<?php
namespace Bakame\Http\StructuredFields\Validation;
/**
* General Error Code-.
*
* When adding new codes the name MUST be prefixed with
* a `@` to avoid conflicting with parameters keys.
*/
enum ErrorCode: string
{
case ItemFailedParsing = '@item.failed.parsing';
case ItemValueFailedValidation = '@item.value.failed.validation';
case ParametersFailedParsing = '@parameters.failed.parsing';
case ParametersMissingConstraints = '@parameters.missing.constraints';
case ParametersFailedCriteria = '@parameters.failed.criteria';
/**
* @return array<string>
*/
public static function list(): array
{
return array_map(fn (self $case) => $case->value, self::cases());
}
}
|