Skip to content

Commit 96f3bfe

Browse files
committed
Keep forbidding empty replacement in ReplaceOne
1 parent 4609acf commit 96f3bfe

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/Operation/ReplaceOne.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function __construct(string $databaseName, string $collectionName, $filte
8989
throw new InvalidArgumentException('First key in $replacement argument is an update operator');
9090
}
9191

92-
if ($replacement !== [] && is_pipeline($replacement)) {
92+
if ($replacement === [] || is_pipeline($replacement)) {
9393
throw new InvalidArgumentException('$replacement argument is a pipeline');
9494
}
9595

tests/Operation/ReplaceOneTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ public function testConstructorReplacementArgument($replacement): void
3737
public function provideReplacementDocuments()
3838
{
3939
return $this->wrapValuesForDataProvider([
40-
[],
4140
['y' => 1],
4241
(object) ['y' => 1],
4342
new BSONDocument(['y' => 1]),

0 commit comments

Comments
 (0)