Skip to content

Commit

Permalink
Drop default parameter values where parameters are in fact required, …
Browse files Browse the repository at this point in the history
…fixes php 8.0 compat
  • Loading branch information
piotr-cz committed Apr 27, 2021
1 parent ec606af commit fdc1f5c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/MongoSql/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function __toString(): string
* in favor of
* `$collection->find([], ['limit' => 1])`
*/
public function find($filter = [], array $options = []): CursorInterface
public function find($filter, array $options = []): CursorInterface
{
return new Cursor($this->connection, $this->queryBuilder, $this->collectionName, $filter, $options);
}
Expand All @@ -140,7 +140,7 @@ public function find($filter = [], array $options = []): CursorInterface
* @param array [$options]
* @return array|null
*/
public function findOne($filter = [], array $options = []): ?array
public function findOne($filter, array $options = []): ?array
{
$results = $this->find($filter, array_merge($options, [
'limit' => 1
Expand Down Expand Up @@ -207,7 +207,7 @@ public function insertOne(&$document): bool
* @param array [$options]
* @return bool
*/
public function updateMany($filter = [], array $update, array $options = []): bool
public function updateMany($filter, array $update, array $options = []): bool
{
$stmt = $this->connection->prepare(
<<<SQL
Expand Down Expand Up @@ -245,7 +245,7 @@ public function updateMany($filter = [], array $update, array $options = []): bo
* @param array $update
* @return bool
*/
public function updateOne($filter = [], array $update): bool
public function updateOne($filter, array $update): bool
{
return $this->updateMany($filter, $update, [
'limit' => 1
Expand Down Expand Up @@ -275,7 +275,7 @@ public function replaceOne(array $filter, array $replace): bool
SQL
);

$stmt->execute([':data' => QueryBuilder::jsonEncode($replace)]);
$stmt->execute([':data' => QueryBuilder::jsonEncode($replace)]);

return true;
}
Expand Down

0 comments on commit fdc1f5c

Please sign in to comment.