Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
19 | 11 | protected function resolveByContainer($ref, ContainerInterface $container, $expectedClass) |
|
20 | { |
||
21 | try { |
||
22 | 11 | $entry = $container->get($ref); |
|
23 | 11 | } catch (NotFoundExceptionInterface $e) { |
|
24 | 2 | throw new UnresolvedException('Could not found an entry from the container.', 0, $e); |
|
25 | 2 | } catch (ContainerExceptionInterface $e) { |
|
26 | 2 | throw new UnresolvedException('Something wrong with the container.', 0, $e); |
|
27 | } |
||
28 | |||
29 | 7 | $this->assertInstanceOf($expectedClass, $entry); |
|
30 | |||
31 | 5 | return $entry; |
|
32 | } |
||
33 | |||
49 |