WS-6 v1.3-delta D1 — Foundation delta (data layer + exception hierarchy) #10

Merged
bert.hausmans merged 9 commits from feat/ws-6-v1.3-delta-d1 into main 2026-05-08 02:32:35 +02:00
Showing only changes of commit b6b63a7121 - Show all commits

View File

@@ -37,4 +37,31 @@ enum FormFieldBindingMergeStrategy: string
{
return $this !== self::Append;
}
/**
* Whether this strategy is structurally valid against the given target
* type.
*
* Per RFC-WS-6 §V1 + ARCH-BINDINGS §4.2 (strategy x target-type validity matrix).
*
* | SCALAR | COLLECTION | RELATION |
* Overwrite | valid | valid* | valid |
* Append | INVALID| valid | INVALID |
* Replace | valid | valid | valid |
* FirstWriteWins | valid | valid | valid |
*
* * unusual but valid (overwrites entire collection)
*
* The PublishGuard AppendStrategyRequiresCollectionTarget uses this
* method to validate at publish time. Append on scalars is rejected
* because it requires a fingerprint mechanism for retry-idempotency
* that would embed implementation detail in domain data.
*/
public function validForTargetType(BindingTargetType $type): bool
{
return match ($this) {
self::Append => $type === BindingTargetType::COLLECTION,
default => true,
};
}
}