Skip to content

Commit 06234eb

Browse files
committed
Refactor Find::getCommandDocument
Remove private function createCommandDocument introduced by c7b2b03 and used only for the explain command.
1 parent 83c0f5e commit 06234eb

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

src/Operation/Find.php

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -329,21 +329,6 @@ public function execute(Server $server)
329329
* @return array
330330
*/
331331
public function getCommandDocument()
332-
{
333-
$cmd = $this->createCommandDocument();
334-
335-
// Read concern can change the query plan
336-
if (isset($this->options['readConcern'])) {
337-
$cmd['readConcern'] = $this->options['readConcern'];
338-
}
339-
340-
return $cmd;
341-
}
342-
343-
/**
344-
* Construct a command document for Find
345-
*/
346-
private function createCommandDocument(): array
347332
{
348333
$cmd = ['find' => $this->collectionName, 'filter' => (object) $this->filter];
349334

@@ -353,6 +338,11 @@ private function createCommandDocument(): array
353338
return $cmd;
354339
}
355340

341+
// Read concern can change the query plan
342+
if (isset($this->options['readConcern'])) {
343+
$cmd['readConcern'] = $this->options['readConcern'];
344+
}
345+
356346
// maxAwaitTimeMS is a Query level option so should not be considered here
357347
unset($options['maxAwaitTimeMS']);
358348

0 commit comments

Comments
 (0)