Skip to content

Commit

Permalink
fix create collection with empty params
Browse files Browse the repository at this point in the history
  • Loading branch information
sokil authored Jun 15, 2017
1 parent ba7cacc commit 726238a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,13 @@ private function getCollectionDefinition($name, array $defaultDefinition = null)
* @return \Sokil\Mongo\Collection
* @throws \Sokil\Mongo\Exception
*/
public function createCollection($name, array $options = [])
public function createCollection($name, array $options = null)
{
$classDefinition = $this->getCollectionDefinition($name);
$classDefinition->merge($options);

if (!empty($options)) {
$classDefinition->merge($options);
}

$mongoCollection = $this->getMongoDB()->createCollection(
$name,
Expand Down

0 comments on commit 726238a

Please sign in to comment.