Skip to content

Commit fd78b93

Browse files
committed
Add clarifying comment on skipping validation
1 parent 8f93eee commit fd78b93

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Operation/BulkWrite.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ private function validateOperations(array $operations, ?DocumentCodec $codec): a
294294

295295
switch ($type) {
296296
case self::INSERT_ONE:
297+
// $args[0] was already validated above. Since DocumentCodec::encode will always return a Document
298+
// instance, there is no need to re-validate the returned value here.
297299
if ($codec) {
298300
$operations[$i][$type][0] = $codec->encode($args[0]);
299301
}

0 commit comments

Comments
 (0)