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