From b20703f058e8dd432c518e67a330c941842263b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Wed, 18 Sep 2024 13:04:41 +0200 Subject: [PATCH] Handle driver deprecation on `Cursor::getId` and `new UTCDateTime(string)` (#1418) * PHPC-2412 PHPLIB-1489 Address CursorId in ChangeStream * PHPC-2443 Handle deprecation on UTCDateTime from string --- src/ChangeStream.php | 2 +- tests/GridFS/StreamWrapperFunctionalTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ChangeStream.php b/src/ChangeStream.php index 5a0a76924..7260f495d 100644 --- a/src/ChangeStream.php +++ b/src/ChangeStream.php @@ -261,7 +261,7 @@ private function onIteration(bool $incrementKey): void * have been received in the last response. Therefore, we can unset the * resumeCallable. This will free any reference to Watch as well as the * only reference to any implicit session created therein. */ - if ((string) $this->getCursorId() === '0') { + if ((string) $this->getCursorId(true) === '0') { $this->resumeCallable = null; } diff --git a/tests/GridFS/StreamWrapperFunctionalTest.php b/tests/GridFS/StreamWrapperFunctionalTest.php index 8aea21915..fc8c45523 100644 --- a/tests/GridFS/StreamWrapperFunctionalTest.php +++ b/tests/GridFS/StreamWrapperFunctionalTest.php @@ -46,7 +46,7 @@ public function setUp(): void parent::setUp(); $this->filesCollection->insertMany([ - ['_id' => 'length-10', 'length' => 10, 'chunkSize' => 4, 'uploadDate' => new UTCDateTime('1484202200000')], + ['_id' => 'length-10', 'length' => 10, 'chunkSize' => 4, 'uploadDate' => new UTCDateTime(1484202200000)], ]); $this->chunksCollection->insertMany([