Skip to content

Commit b97cffb

Browse files
authored
PHPLIB-1162: Remove unused argument Explainable::getCommandDocument(Server $server) (#1102)
Not a breaking change because the interface is internal.
1 parent 487d3e8 commit b97cffb

18 files changed

+29
-31
lines changed

src/Operation/Aggregate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ public function execute(Server $server)
306306
* @see Explainable::getCommandDocument()
307307
* @return array
308308
*/
309-
public function getCommandDocument(Server $server)
309+
public function getCommandDocument()
310310
{
311311
$cmd = $this->createCommandDocument();
312312

src/Operation/Count.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public function execute(Server $server)
170170
* @see Explainable::getCommandDocument()
171171
* @return array
172172
*/
173-
public function getCommandDocument(Server $server)
173+
public function getCommandDocument()
174174
{
175175
$cmd = $this->createCommandDocument();
176176

src/Operation/Delete.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public function execute(Server $server)
175175
* @see Explainable::getCommandDocument()
176176
* @return array
177177
*/
178-
public function getCommandDocument(Server $server)
178+
public function getCommandDocument()
179179
{
180180
return ['delete' => $this->collectionName, 'deletes' => [['q' => $this->filter] + $this->createDeleteOptions()]];
181181
}

src/Operation/DeleteMany.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ public function execute(Server $server)
9191
* @see Explainable::getCommandDocument()
9292
* @return array
9393
*/
94-
public function getCommandDocument(Server $server)
94+
public function getCommandDocument()
9595
{
96-
return $this->delete->getCommandDocument($server);
96+
return $this->delete->getCommandDocument();
9797
}
9898
}

src/Operation/DeleteOne.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ public function execute(Server $server)
9191
* @see Explainable::getCommandDocument()
9292
* @return array
9393
*/
94-
public function getCommandDocument(Server $server)
94+
public function getCommandDocument()
9595
{
96-
return $this->delete->getCommandDocument($server);
96+
return $this->delete->getCommandDocument();
9797
}
9898
}

src/Operation/Distinct.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public function execute(Server $server)
163163
* @see Explainable::getCommandDocument()
164164
* @return array
165165
*/
166-
public function getCommandDocument(Server $server)
166+
public function getCommandDocument()
167167
{
168168
$cmd = $this->createCommandDocument();
169169

src/Operation/EstimatedDocumentCount.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ public function execute(Server $server)
114114
* @see Explainable::getCommandDocument()
115115
* @return array
116116
*/
117-
public function getCommandDocument(Server $server)
117+
public function getCommandDocument()
118118
{
119-
return $this->createCount()->getCommandDocument($server);
119+
return $this->createCount()->getCommandDocument();
120120
}
121121

122122
private function createCount(): Count

src/Operation/Explain.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function execute(Server $server)
113113
throw UnsupportedException::explainNotSupported();
114114
}
115115

116-
$cursor = $server->executeCommand($this->databaseName, $this->createCommand($server), $this->createOptions());
116+
$cursor = $server->executeCommand($this->databaseName, $this->createCommand(), $this->createOptions());
117117

118118
if (isset($this->options['typeMap'])) {
119119
$cursor->setTypeMap($this->options['typeMap']);
@@ -125,9 +125,9 @@ public function execute(Server $server)
125125
/**
126126
* Create the explain command.
127127
*/
128-
private function createCommand(Server $server): Command
128+
private function createCommand(): Command
129129
{
130-
$cmd = ['explain' => $this->explainable->getCommandDocument($server)];
130+
$cmd = ['explain' => $this->explainable->getCommandDocument()];
131131

132132
foreach (['comment', 'verbosity'] as $option) {
133133
if (isset($this->options[$option])) {

src/Operation/Explainable.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717

1818
namespace MongoDB\Operation;
1919

20-
use MongoDB\Driver\Server;
21-
2220
/**
2321
* Explainable interface for explainable operations (aggregate, count, distinct,
2422
* find, findAndModify, delete, and update).
@@ -32,5 +30,5 @@ interface Explainable extends Executable
3230
*
3331
* @return array
3432
*/
35-
public function getCommandDocument(Server $server);
33+
public function getCommandDocument();
3634
}

src/Operation/Find.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ public function execute(Server $server)
328328
* @see Explainable::getCommandDocument()
329329
* @return array
330330
*/
331-
public function getCommandDocument(Server $server)
331+
public function getCommandDocument()
332332
{
333333
$cmd = $this->createCommandDocument();
334334

0 commit comments

Comments
 (0)