From f9e6c35bd24b2f184dbe599b1561938e484a9a28 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Sun, 22 Oct 2023 09:55:42 +0200 Subject: [PATCH] - --- rector.php | 3 +++ src/Operation/Watch.php | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/rector.php b/rector.php index 27f05d753..dbbd9ba5d 100644 --- a/rector.php +++ b/rector.php @@ -2,6 +2,7 @@ use Rector\Config\RectorConfig; use Rector\DeadCode\Rector\ClassLike\RemoveAnnotationRector; +use Rector\Php70\Rector\StmtsAwareInterface\IfIssetToCoalescingRector; use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector; use Rector\Set\ValueObject\LevelSetList; @@ -17,6 +18,8 @@ $rectorConfig->sets([LevelSetList::UP_TO_PHP_74]); $rectorConfig->skip([ + // Do not use ternaries extensively + IfIssetToCoalescingRector::class, // Not necessary in documentation examples JsonThrowOnErrorRector::class => [ __DIR__ . '/tests/DocumentationExamplesTest.php', diff --git a/src/Operation/Watch.php b/src/Operation/Watch.php index a71783cab..f38bb2c00 100644 --- a/src/Operation/Watch.php +++ b/src/Operation/Watch.php @@ -391,7 +391,15 @@ private function getInitialResumeToken() return $this->postBatchResumeToken; } - return $this->changeStreamOptions['startAfter'] ?? $this->changeStreamOptions['resumeAfter'] ?? null; + if (isset($this->changeStreamOptions['startAfter'])) { + return $this->changeStreamOptions['startAfter']; + } + + if (isset($this->changeStreamOptions['resumeAfter'])) { + return $this->changeStreamOptions['resumeAfter']; + } + + return null; } /**