| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 43 | 5 | public function createFromDsn(string $dsn): FailedJobRepositoryInterface |
|
| 44 | { |
||
| 45 | 5 | $parsedDsn = Dsn::parse($dsn); |
|
| 46 | |||
| 47 | 5 | $factory = $this->factories[$parsedDsn->getScheme()] ?? null; |
|
| 48 | |||
| 49 | 5 | if (!$factory) { |
|
| 50 | 1 | throw new InvalidArgumentException('Unsupported failer scheme "' . $parsedDsn->getScheme() . '"'); |
|
| 51 | } |
||
| 52 | |||
| 53 | 4 | return $factory->create($parsedDsn); |
|
| 54 | } |
||
| 56 |