| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | 5 | public static function create(ToggleConfig $config, ?Connection $connection): FeatureRepository |
|
| 27 | { |
||
| 28 | 5 | $driver = $config->driver(); |
|
| 29 | |||
| 30 | 5 | if ('inmemory' === $driver) { |
|
| 31 | 2 | return new InMemoryFeatureRepository(); |
|
| 32 | } |
||
| 33 | |||
| 34 | 3 | if ('dbal' === $driver) { |
|
| 35 | /** @var Connection $connection */ |
||
| 36 | 2 | return new DbalFeatureRepository($connection); |
|
| 37 | } |
||
| 38 | |||
| 39 | 1 | throw new InvalidArgumentException('Valid driver required'); |
|
| 40 | } |
||
| 42 |