Conditions | 4 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
30 | 5 | private static function instantiateResource(Resource $instance, Request $request): Resource |
|
31 | { |
||
32 | 5 | if (!empty($instance->getChildResources())) { |
|
33 | 5 | foreach ($instance->getChildResources() as $property => $childResource) { |
|
34 | 5 | $instance->{$property} = new $childResource($request); |
|
35 | |||
36 | 5 | if (!empty($instance->{$property}->getChildResources())) { |
|
37 | 5 | self::instantiateResource($instance->{$property}, $request); |
|
38 | } |
||
39 | } |
||
40 | } |
||
41 | |||
42 | 5 | return $instance; |
|
43 | } |
||
44 | } |
||
45 |