| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 30 | 5 | public function resolve(string $className): RepositoryInterface |
|
| 31 | { |
||
| 32 | 5 | foreach ($this->chain as $resolverName) { |
|
| 33 | 5 | $resolver = $this->getResolver($resolverName); |
|
| 34 | |||
| 35 | try { |
||
| 36 | 4 | return $resolver->resolve($className); |
|
| 37 | 3 | } catch (CouldNotResolve $exception) { |
|
| 38 | 3 | continue; |
|
| 39 | } |
||
| 40 | } |
||
| 41 | |||
| 42 | 2 | $exception = new CouldNotResolve(); |
|
| 43 | 2 | $exception->setRepositoryCode($className); |
|
| 44 | |||
| 45 | 2 | throw $exception; |
|
| 46 | } |
||
| 73 |