diff --git a/src/ChangeStream.php b/src/ChangeStream.php index f54e012d2..cf994116c 100644 --- a/src/ChangeStream.php +++ b/src/ChangeStream.php @@ -114,7 +114,7 @@ public function current() return $value; } - return $this->codec->decodeIfSupported($value); + return $this->codec->decode($value); } /** @return CursorId */ diff --git a/src/Operation/FindAndModify.php b/src/Operation/FindAndModify.php index c1711cdc4..41b3d1465 100644 --- a/src/Operation/FindAndModify.php +++ b/src/Operation/FindAndModify.php @@ -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; }