Conditions | 4 |
Paths | 6 |
Total Lines | 23 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
26 | public function create($container) |
||
27 | { |
||
28 | $class = ''; |
||
29 | |||
30 | foreach ($this->config as $containerClass => $configuratorClass) { |
||
31 | if (is_a($container, $containerClass)) { |
||
32 | $class = $configuratorClass; |
||
33 | break; |
||
34 | } |
||
35 | } |
||
36 | |||
37 | if (!$class) { |
||
38 | throw UnknownContainerException::fromContainerName( |
||
39 | get_class($container), |
||
40 | array_keys($this->config) |
||
41 | ); |
||
42 | } |
||
43 | |||
44 | $instance = new $class(); |
||
45 | $instance->setContainer($container); |
||
46 | |||
47 | return $instance; |
||
48 | } |
||
49 | } |
||
50 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.