| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | public function getDatabaseManager(array $dbConnectionSpec) |
||
| 28 | { |
||
| 29 | if (!isset($dbConnectionSpec['vendor'])) { |
||
| 30 | throw new OutOfBoundsException("Unspecified database type (miss 'vendor' key in definition)"); |
||
| 31 | } |
||
| 32 | |||
| 33 | $vendor = $dbConnectionSpec['vendor']; |
||
| 34 | if (isset($this->databaseManagers[$vendor])) { |
||
| 35 | $class = $this->databaseManagers[$vendor]; |
||
| 36 | return new $class($dbConnectionSpec); |
||
| 37 | } |
||
| 38 | |||
| 39 | throw new OutOfBoundsException("Unsupported database type '$vendor'"); |
||
| 40 | } |
||
| 42 |