| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 41 | private static function getMongoCollectionFromConfig(array $config) : MongoDB\Collection |
||
| 42 | { |
||
| 43 | $collection = $config['collection']; |
||
| 44 | if ($collection instanceof MongoDB\Collection) { |
||
| 45 | return $collection; |
||
| 46 | } |
||
| 47 | |||
| 48 | $uri = $config['uri']; |
||
| 49 | $database = $config['database']; |
||
| 50 | return (new MongoDB\Client($uri))->selectDatabase($database)->selectCollection($collection); |
||
| 51 | } |
||
| 53 |