Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/5382' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Writer/MongoDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function __construct($mongo, $database = null, $collection = null, array
}
if (is_array($mongo)) {
parent::__construct($mongo);
$saveOptions = isset($mongo['save_options']) ? $mongo['save_options'] : null;
$saveOptions = isset($mongo['save_options']) ? $mongo['save_options'] : array();
$collection = isset($mongo['collection']) ? $mongo['collection'] : null;
$database = isset($mongo['database']) ? $mongo['database'] : null;
$mongo = isset($mongo['mongo']) ? $mongo['mongo'] : null;
Expand All @@ -74,10 +74,10 @@ public function __construct($mongo, $database = null, $collection = null, array
}

if (!($mongo instanceof MongoClient || $mongo instanceof Mongo)) {
throw new Exception\InvalidArgumentException(
throw new Exception\InvalidArgumentException(sprintf(
'Parameter of type %s is invalid; must be MongoClient or Mongo',
(is_object($mongo) ? get_class($mongo) : gettype($mongo))
);
));
}

$this->mongoCollection = $mongo->selectCollection($database, $collection);
Expand Down

0 comments on commit a65de03

Please sign in to comment.