Conditions | 5 |
Paths | 5 |
Total Lines | 16 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 5.0187 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
26 | 12 | public function resolve(Reference $reference, Application $application) |
|
27 | { |
||
28 | try { |
||
29 | 12 | return $application->make($reference->getId()); |
|
30 | 9 | } catch (\Exception $exception) { |
|
31 | 6 | switch (true) { |
|
32 | 9 | case $reference->throwExceptionOnInvalidBehaviour(): |
|
33 | 3 | throw new ServiceNotFoundException(sprintf('Could not find service "%s"', $reference->getId())); |
|
34 | |||
35 | 6 | case $reference->returnNullOnInvalidBehaviour(): |
|
36 | 5 | case $reference->ignoreOnInvalidBehaviour(): |
|
37 | 4 | default: |
|
38 | 6 | return null; |
|
39 | } |
||
40 | } |
||
41 | } |
||
42 | } |
||
43 |