Conditions | 4 |
Paths | 4 |
Total Lines | 23 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
39 | public function render(array $classes): string |
||
40 | { |
||
41 | $content = '<?php' . PHP_EOL; |
||
42 | $content .= 'namespace PHPSTORM_META {' . PHP_EOL; |
||
43 | |||
44 | foreach ($classes as $class) { |
||
45 | $target = $class->getName(); |
||
46 | $content .= "override(\\{$target}(0), map([" . PHP_EOL; |
||
47 | foreach ($class->getMembers() as $member) { |
||
48 | if ($member instanceof ClassProperty) { |
||
49 | $name = $member->getName(); |
||
50 | $type = Helpers::fqcn($member->getTypes()[0]); |
||
51 | |||
52 | $content .= "'{$name}' => {$type}::class," . PHP_EOL; |
||
53 | } |
||
54 | } |
||
55 | $content .= "]));" . PHP_EOL; |
||
56 | } |
||
57 | |||
58 | $content .= "}" . PHP_EOL; |
||
59 | |||
60 | return $content; |
||
61 | } |
||
62 | } |
||
63 |