| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | public static function factory(CredentialsInterface $credentials, string $adapter = self::PDO, array $options = null): AdapterInterface |
||
| 22 | { |
||
| 23 | switch ($adapter) { |
||
| 24 | case self::PDO: |
||
| 25 | return PDOAdapter::factory($credentials, $options); |
||
| 26 | |||
| 27 | case self::MYSQLI: |
||
| 28 | return MysqliAdapter::factory($credentials, $options); |
||
| 29 | |||
| 30 | default: |
||
| 31 | throw new \InvalidArgumentException("Invalid adapter."); |
||
| 32 | } |
||
| 33 | } |
||
| 34 | } |
||
| 35 |