Skip to content

Commit

Permalink
Use decode() instead of decodeIfSupported()
Browse files Browse the repository at this point in the history
  • Loading branch information
alcaeus committed Aug 4, 2023
1 parent c3a3164 commit 8f634dd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ChangeStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function current()
return $value;
}

return $this->codec->decodeIfSupported($value);
return $this->codec->decode($value);
}

/** @return CursorId */
Expand Down
3 changes: 1 addition & 2 deletions src/Operation/FindAndModify.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,7 @@ public function execute(Server $server)
$result = current($cursor->toArray());
assert($result instanceof Document);

$decoded = $this->options['codec']->decodeIfSupported($result->get('value'));
assert($decoded === null || is_object($decoded));
$decoded = $this->options['codec']->decode($result->get('value'));

return $decoded;
}
Expand Down

0 comments on commit 8f634dd

Please sign in to comment.