Reference
Check diagnostics
Every code revision:check reports, its severity, its cause and its fix.
Errors fail revision:check and assertRevisionsAreConsistent(); warnings do not.
The enum
| Code | Severity | Cause | Fix |
|---|---|---|---|
order-missing-case | error | a case is missing from order() | add it, at the end if it is new |
order-duplicate-case | error | a case appears twice in order() | remove the duplicate |
Bounds and history
| Code | Severity | Cause | Fix |
|---|---|---|---|
lifetime-inverted | error | until() before since() | swap or correct the bounds |
since-older-than-group | error | a member's since() is older than its group's | give a newer bound, or move the field out of the group |
until-newer-than-group | error | a member's until() is newer than its group's | give an older bound, or move the field out of the group |
bound-repeated | warning | since() or until() called twice | keep one |
history-unordered | error | a was() repeated, or on the head | one was() per revision, never on the head: write was(N->previous()) |
history-before-since | error | a was() before the field exists | delete it |
history-after-until | error | a was() after the field is removed | delete it |
Conversions and requests
| Code | Severity | Cause | Fix |
|---|---|---|---|
conversion-missing | error | a type change neither automatic nor given | give down: (responses) or up: (requests) |
conversion-lossy | warning | a lossy automatic conversion without closure | give the closure, if the cast is not what clients need |
required-since-without-default | error | a required()->since(R) without default: | add default:, or set missing_default to 'null' |
name-collision | error | two fields under one name at a revision | rename one, or bound them so they never coexist |
Resources
| Code | Severity | Cause | Fix |
|---|---|---|---|
eager-value | error | a plain value in a resource ('x' => $this->x) | wrap it in a descriptor |
native-condition | warning | $this->when(), mergeWhen()… in a resource | use ->when(), ->whenLoaded() on the descriptor |
unknown-resource | error | Schema::resource() on a class that cannot be nested | nest a class implementing Revisioned |
resource-absent | error | a visible Schema::resource() field nesting a class absent at its revision | give the field the bounds of the class lifetime |
Export
| Code | Severity | Cause | Fix |
|---|---|---|---|
component-conflict | error | one component name, two bodies | give each body its own component() name |
schema-override | warning | a rule's JSON Schema overrides the field's type | change the rule, or the field's type |
definition-error | error | a declaration throws | read the message: a DefinitionException names the mistake |
Lock
| Code | Severity | Cause | Fix |
|---|---|---|---|
lock-mismatch | error | a locked revision changed: a field, a type, a class gone | usually a forgotten since(); re-lock only if the change is meant for published clients |
lock-order-changed | error | a locked revision moved in order() | restore order() |
Packages and applications add their own codes: see Custom checks.