Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
21 | public function __invoke(string ...$classes): string |
||
22 | { |
||
23 | $factory = Factory::class; |
||
24 | $body = ''; |
||
25 | foreach ($classes as $class) { |
||
26 | if ($this->reflection->isInstantiable($class)) { |
||
27 | $dependencies = var_export($this->reflection->getDependencies($class), true); |
||
28 | $body .= PHP_EOL . "'{$class}' => new $factory('$class', ...$dependencies)," . PHP_EOL; |
||
29 | } |
||
30 | } |
||
31 | return "<?php |
||
32 | |||
33 | declare(strict_types=1); |
||
34 | |||
35 | return [{$body}];"; |
||
36 | } |
||
38 |