Commit ccf1eba5 authored by Jeremy Mikola's avatar Jeremy Mikola

PHPLIB-45: Support stdClass listCollections() filter option

parent a32ac4f7
...@@ -164,7 +164,9 @@ class Database ...@@ -164,7 +164,9 @@ class Database
throw new InvalidArgumentException(sprintf('Expected filter to be array or object, %s given', gettype($filter))); throw new InvalidArgumentException(sprintf('Expected filter to be array or object, %s given', gettype($filter)));
} }
if (array_key_exists('name', $filter)) { if (array_key_exists('name', (array) $filter)) {
$filter = (array) $filter;
if ( ! is_string($filter['name'])) { if ( ! is_string($filter['name'])) {
throw new InvalidArgumentException(sprintf('Filter "name" must be a string for MongoDB <2.8, %s given', gettype($filter['name']))); throw new InvalidArgumentException(sprintf('Filter "name" must be a string for MongoDB <2.8, %s given', gettype($filter['name'])));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment