InvalidManifestException
Thrown when a decoded manifest array cannot be turned into a valid value object — a required field is absent, a version is not valid semver, or a field has the wrong type. Implements the framework marker {@see MilpaExceptionInterface} so hosts can catch every Milpa-originated error uniformly. Messages are technical English and name the value-object type, the offending field, and (where known) the record subject, so the failure points at the exact manifest entry.
InvalidManifestException::missingField()
public static function missingField(string $type, string $field, ?string $subject = null): selfA required field is absent (or empty).
Parameters
| Name | Type | Description |
|---|---|---|
| $type | string | |
| $field | string | |
| $subject | ?string |
InvalidManifestException::invalidVersion()
public static function invalidVersion(string $type, string $field, string $value, ?string $subject = null): selfA version field does not parse as a semantic version.
Parameters
| Name | Type | Description |
|---|---|---|
| $type | string | |
| $field | string | |
| $value | string | |
| $subject | ?string |
InvalidManifestException::notAnArray()
public static function notAnArray(string $type, string $field, ?string $subject = null): selfA field expected to hold an array holds something else.
Parameters
| Name | Type | Description |
|---|---|---|
| $type | string | |
| $field | string | |
| $subject | ?string |
InvalidManifestException::unexpectedValue()
public static function unexpectedValue(string $type, string $field, string $value, ?string $subject = null): selfA field holds a value outside the set the type accepts (e.g. an unknown enum case).
Parameters
| Name | Type | Description |
|---|---|---|
| $type | string | |
| $field | string | |
| $value | string | |
| $subject | ?string |
InvalidManifestException::invalidIsoDate()
public static function invalidIsoDate(string $type, string $field, string $value, ?string $subject = null): selfA date/datetime field does not parse as an ISO-8601 value (relative expressions like "now" are rejected too — the resolver stays pure, so the clock must be explicit data, never an ambient read).
Parameters
| Name | Type | Description |
|---|---|---|
| $type | string | |
| $field | string | |
| $value | string | |
| $subject | ?string |
InvalidManifestException::acceptedRiskWithoutReason()
public static function acceptedRiskWithoutReason(string $code): selfAn accepted risk was declared without a reason. Accepting a risk without saying why silences it, which is exactly what `acceptedRisks` exists to prevent — so the omission is a hard error.
Parameters
| Name | Type | Description |
|---|---|---|
| $code | string |
InvalidManifestException::acceptedRiskLegacyShape()
public static function acceptedRiskLegacyShape(string $value): selfThe pre-0.2 bare-string `acceptedRisks` shape was used; the message teaches the object shape that replaced it (a code alone can never carry a reason, so it could only ever silence).
Parameters
| Name | Type | Description |
|---|---|---|
| $value | string |
InvalidManifestException::missingFile()
public static function missingFile(string $path): selfThe manifest file does not exist at the given path (an ingestion-layer failure — the path is the subject, since there is no decoded content to point at yet).
Parameters
| Name | Type | Description |
|---|---|---|
| $path | string |
InvalidManifestException::unreadableFile()
public static function unreadableFile(string $path): selfThe manifest file exists but could not be read from disk.
Parameters
| Name | Type | Description |
|---|---|---|
| $path | string |
InvalidManifestException::invalidJson()
public static function invalidJson(string $path, string $detail, ?Throwable $previous = null): selfThe manifest file's contents are not valid JSON; `$detail` carries the decoder's reason.
Parameters
| Name | Type | Description |
|---|---|---|
| $path | string | |
| $detail | string | |
| $previous | ?Throwable |
InvalidManifestException::malformed()
public static function malformed(string $path, string $detail, ?Throwable $previous = null): selfThe manifest decoded but is structurally wrong; `$detail` (often a wrapped field-level message) says what, and the path says where — so a malformed manifest always names both.
Parameters
| Name | Type | Description |
|---|---|---|
| $path | string | |
| $detail | string | |
| $previous | ?Throwable |