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

CodeSeverityCauseFix
order-missing-caseerrora case is missing from order()add it, at the end if it is new
order-duplicate-caseerrora case appears twice in order()remove the duplicate

Bounds and history

CodeSeverityCauseFix
lifetime-invertederroruntil() before since()swap or correct the bounds
since-older-than-grouperrora member's since() is older than its group'sgive a newer bound, or move the field out of the group
until-newer-than-grouperrora member's until() is newer than its group'sgive an older bound, or move the field out of the group
bound-repeatedwarningsince() or until() called twicekeep one
history-unorderederrora was() repeated, or on the headone was() per revision, never on the head: write was(N->previous())
history-before-sinceerrora was() before the field existsdelete it
history-after-untilerrora was() after the field is removeddelete it

Conversions and requests

CodeSeverityCauseFix
conversion-missingerrora type change neither automatic nor givengive down: (responses) or up: (requests)
conversion-lossywarninga lossy automatic conversion without closuregive the closure, if the cast is not what clients need
required-since-without-defaulterrora required()->since(R) without default:add default:, or set missing_default to 'null'
name-collisionerrortwo fields under one name at a revisionrename one, or bound them so they never coexist

Resources

CodeSeverityCauseFix
eager-valueerrora plain value in a resource ('x' => $this->x)wrap it in a descriptor
native-conditionwarning$this->when(), mergeWhen()… in a resourceuse ->when(), ->whenLoaded() on the descriptor
unknown-resourceerrorSchema::resource() on a class that cannot be nestednest a class implementing Revisioned
resource-absenterrora visible Schema::resource() field nesting a class absent at its revisiongive the field the bounds of the class lifetime

Export

CodeSeverityCauseFix
component-conflicterrorone component name, two bodiesgive each body its own component() name
schema-overridewarninga rule's JSON Schema overrides the field's typechange the rule, or the field's type
definition-errorerrora declaration throwsread the message: a DefinitionException names the mistake

Lock

CodeSeverityCauseFix
lock-mismatcherrora locked revision changed: a field, a type, a class goneusually a forgotten since(); re-lock only if the change is meant for published clients
lock-order-changederrora locked revision moved in order()restore order()

Packages and applications add their own codes: see Custom checks.