This commit is contained in:
Jake Barnby 2025-10-03 00:39:14 +13:00
parent 44e7068a9a
commit 522a4d2a62
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C
3 changed files with 5 additions and 3 deletions

View file

@ -134,7 +134,9 @@ class TransactionState
case 'upsert':
$docId = $documentId ?? ($data['$id'] ?? null);
if (!$docId) { break; }
if (!$docId) {
break;
}
$state[$collectionId][$docId] = [
'action' => 'upsert',
'document' => new Document($data),

View file

@ -144,7 +144,7 @@ class Upsert extends Action
'transactions',
$transactionId,
'operations',
1
1
);
});

View file

@ -151,7 +151,7 @@ class Operation extends Validator
$this->description = "Key 'data' must be an array";
return false;
}
} else if (\array_key_exists('data', $value)) {
} elseif (\array_key_exists('data', $value)) {
// Data is optional but if provided, must be an array
if (!\is_array($value['data'])) {
$this->description = "Key 'data' must be an array";