Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | 2 | static function from(array $ids) |
|
|
|||
18 | { |
||
19 | 2 | $references = []; |
|
20 | |||
21 | 2 | foreach ($ids as $id) { |
|
22 | 2 | if (!is_string($id)) { |
|
23 | 1 | throw new InvalidConfigException('Values of an array must be string alias or class name.'); |
|
24 | } |
||
25 | 2 | $references[] = DynamicReference::to($id); |
|
26 | } |
||
27 | |||
28 | 1 | return $references; |
|
29 | } |
||
31 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.