From 5206ea94f69b434a2ca0b09abd668fd1b6f18969 Mon Sep 17 00:00:00 2001 From: shimon Date: Mon, 20 Oct 2025 14:04:34 +0300 Subject: [PATCH] linter and typo fix --- src/Client.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Client.php b/src/Client.php index 1d54284cb3..93ea8abd83 100644 --- a/src/Client.php +++ b/src/Client.php @@ -98,9 +98,9 @@ class Client public const READ_PREFERENCE_NEAREST = 'nearest'; /** - * Commands that don't support readConcern + * Commands that do not support readConcern options */ - private array $readConcernNotSupporteedCommands = [ + private array $readConcernNotSupportedCommands = [ self::COMMAND_GET_MORE, self::COMMAND_KILL_CURSORS ]; @@ -328,11 +328,14 @@ class Client // CRITICAL: Remove readConcern from any non-first operation in a transaction // MongoDB will reject commands with readConcern that have txnNumber but not startTransaction - // Or if the command is in the readConcernNotSupporteedCommands array - if (((isset($command['txnNumber']) && !isset($command['startTransaction']) && isset($command['readConcern'])) + // Or if the command is in the readConcernNotSupportedCommands array if ( - ((isset($command['txnNumber']) && !isset($command['startTransaction']) && isset($command['readConcern'])) - || \in_array(array_key_first($command) ?? '', $this->readConcernNotSupporteedCommands)) + ( + isset($command['txnNumber']) + && !isset($command['startTransaction']) + && isset($command['readConcern']) + ) + || \in_array(array_key_first($command) ?? '', $this->readConcernNotSupportedCommands) ) { unset($command['readConcern']); }