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