Skip to content

Commit 79b828e

Browse files
committed
Rework client-side error logic for hints in updates
1 parent f8f6585 commit 79b828e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Operation/Update.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class Update implements Executable, Explainable
5454
private static $wireVersionForDocumentLevelValidation = 4;
5555

5656
/** @var integer */
57-
private static $wireVersionForHint = 8;
57+
private static $wireVersionForHintServerSideError = 5;
5858

5959
/** @var string */
6060
private $databaseName;
@@ -202,7 +202,10 @@ public function execute(Server $server)
202202
throw UnsupportedException::collationNotSupported();
203203
}
204204

205-
if (isset($this->options['hint']) && ! server_supports_feature($server, self::$wireVersionForHint)) {
205+
/* Server versions >= 3.4.0 raise errors for unknown update
206+
* options. For previous versions, the CRUD spec requires a client-side
207+
* error. */
208+
if (isset($this->options['hint']) && ! server_supports_feature($server, self::$wireVersionForHintServerSideError)) {
206209
throw UnsupportedException::hintNotSupported();
207210
}
208211

0 commit comments

Comments
 (0)