Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 3.7085 |
Changes | 0 |
1 | <?php |
||
18 | 1 | public function resolve($definition) |
|
19 | { |
||
20 | 1 | if (!$definition instanceof AliasDefinition) { |
|
21 | $definitionClass = AliasDefinition::class; |
||
22 | |||
23 | throw new InvalidArgumentException("Argument \$definition must be $definitionClass"); |
||
24 | } |
||
25 | |||
26 | 1 | if (!is_string($definition->getValue())) { |
|
27 | throw new InvalidArgumentException('Value of $definition->getValue() must be string'); |
||
28 | } |
||
29 | |||
30 | 1 | return $this->getContainer()->get($definition->getValue()); |
|
31 | } |
||
32 | } |
||
33 |