InvalidSchemaException
A supported-but-malformed schema (a developer error), detected at parse time by SchemaFormParser. Distinct from a FieldError (user input) and a RegexExecutionException (engine failure). Surfaces switch on the stable `schemaCode`; the message is human text and is never parsed.
InvalidSchemaException::enumMemberInvalid()
public static function enumMemberInvalid(string $field, ?mixed $member, Milpa\Live\Schema\FieldType $type): selfBuilds the error for an enum member that cannot be coerced to the field's base type.
Parameters
| Name | Type | Description |
|---|---|---|
| $field | string | |
| $member | ?mixed | |
| $type | Milpa\Live\Schema\FieldType |
InvalidSchemaException::enumEmpty()
public static function enumEmpty(string $field): selfBuilds the error for an `enum` key present but with no valid members.
Parameters
| Name | Type | Description |
|---|---|---|
| $field | string |
InvalidSchemaException::patternInvalid()
public static function patternInvalid(string $field): selfBuilds the error for a `pattern` that is not a valid regular expression.
Parameters
| Name | Type | Description |
|---|---|---|
| $field | string |
InvalidSchemaException::constraintInvalid()
public static function constraintInvalid(string $field, string $constraint): selfBuilds the error for a malformed numeric or length constraint.
Parameters
| Name | Type | Description |
|---|---|---|
| $field | string | |
| $constraint | string |
InvalidSchemaException::defaultInvalid()
public static function defaultInvalid(string $field, string $reason): selfBuilds the error for a `default` not coercible to the type or outside the enum.
Parameters
| Name | Type | Description |
|---|---|---|
| $field | string | |
| $reason | string |