Conditions | 3 |
Paths | 5 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | 3 | public function resolve(string $className): RepositoryInterface |
|
27 | { |
||
28 | try { |
||
29 | 3 | $resolved = $this->container->get($className); |
|
30 | |||
31 | 2 | if (! ($resolved instanceof RepositoryInterface)) { |
|
32 | 1 | $class = get_class($resolved); |
|
33 | |||
34 | 1 | $message = $class . ' does not implements RepositoryInterface. Refer to documentation'; |
|
35 | 1 | $this->fail($className, $message); |
|
36 | } |
||
37 | |||
38 | 1 | return $resolved; |
|
39 | 2 | } catch (ContainerExceptionInterface $exception) { |
|
40 | 1 | $this->fail($className, $exception->getMessage()); |
|
41 | } |
||
60 |