Skip to content

Commit 63fdbbe

Browse files
committed
Fix bot review
1 parent 8de831c commit 63fdbbe

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/Contracts/Task.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public function isFinished(): bool
147147
* @param array{
148148
* taskUid?: int,
149149
* uid?: int,
150-
* indexUid: non-empty-string,
150+
* indexUid?: non-empty-string,
151151
* status: non-empty-string,
152152
* type: non-empty-string,
153153
* enqueuedAt: non-empty-string,
@@ -165,7 +165,7 @@ public static function fromArray(array $data): Task
165165
{
166166
return new self(
167167
$data['taskUid'] ?? $data['uid'],
168-
$data['indexUid'],
168+
$data['indexUid'] ?? null,
169169
TaskStatus::from($data['status']),
170170
$type = TaskType::from($data['type']),
171171
new \DateTimeImmutable($data['enqueuedAt']),
@@ -186,6 +186,8 @@ public static function fromArray(array $data): Task
186186
TaskType::DumpCreation => null !== $data['details'] ? DumpCreationDetails::fromArray($data['details']) : null,
187187
TaskType::TaskCancelation => null !== $data['details'] ? TaskCancelationDetails::fromArray($data['details']) : null,
188188
TaskType::TaskDeletion => null !== $data['details'] ? TaskDeletionDetails::fromArray($data['details']) : null,
189+
// It’s intentional that SnapshotCreation tasks don’t have a details object
190+
// (no SnapshotCreationDetails exists and tests don’t exercise any details)
189191
TaskType::SnapshotCreation => null,
190192
},
191193
null !== $data['error'] ? TaskError::fromArray($data['error']) : null,

src/Contracts/TaskDetails/DocumentEditionDetails.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public static function fromArray(array $data): self
3434
return new self(
3535
$data['context'],
3636
$data['deletedDocuments'],
37-
$data['deletedDocuments'],
37+
$data['editedDocuments'],
3838
$data['function'],
3939
$data['originalFilter'],
4040
);

0 commit comments

Comments
 (0)