| @@ 55-72 (lines=18) @@ | ||
| 52 | * |
|
| 53 | * @throws MalformedDriverConfigException |
|
| 54 | */ |
|
| 55 | private function setConfig($config) |
|
| 56 | { |
|
| 57 | $allowedConfigKeys = [ |
|
| 58 | 'database', |
|
| 59 | 'host', |
|
| 60 | 'password', |
|
| 61 | 'port', |
|
| 62 | 'username', |
|
| 63 | ]; |
|
| 64 | ||
| 65 | foreach (array_keys($config) as $key) { |
|
| 66 | if (!in_array($key, $allowedConfigKeys)) { |
|
| 67 | throw new MalformedDriverConfigException('Mongo Driver: malformed config parameters'); |
|
| 68 | } |
|
| 69 | } |
|
| 70 | ||
| 71 | $this->config = $config; |
|
| 72 | } |
|
| 73 | ||
| 74 | /** |
|
| 75 | * @codeCoverageIgnore |
|
| @@ 55-74 (lines=20) @@ | ||
| 52 | * |
|
| 53 | * @throws MalformedDriverConfigException |
|
| 54 | */ |
|
| 55 | private function setConfig($config) |
|
| 56 | { |
|
| 57 | $allowedConfigKeys = [ |
|
| 58 | 'database', |
|
| 59 | 'driver', |
|
| 60 | 'host', |
|
| 61 | 'options', |
|
| 62 | 'password', |
|
| 63 | 'port', |
|
| 64 | 'username', |
|
| 65 | ]; |
|
| 66 | ||
| 67 | foreach (array_keys($config) as $key) { |
|
| 68 | if (!in_array($key, $allowedConfigKeys)) { |
|
| 69 | throw new MalformedDriverConfigException('Pdo Driver: malformed config parameters'); |
|
| 70 | } |
|
| 71 | } |
|
| 72 | ||
| 73 | $this->config = $config; |
|
| 74 | } |
|
| 75 | ||
| 76 | /** |
|
| 77 | * @codeCoverageIgnore |
|