protected function getClient($options = null, $uri = 'mongodb://localhost') { $args = [$uri]; if ($options !== null) { $args[] = $options; } $reflection = new \ReflectionClass('MongoClient'); return $reflection->newInstanceArgs($args); }