| Conditions | 3 |
| Paths | 3 |
| Total Lines | 19 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | 8 | public static function generateCode(string $classWillBeEtended): string |
|
| 21 | { |
||
| 22 | 8 | $reflection = new \ReflectionClass($classWillBeEtended); |
|
| 23 | 8 | $methods = $reflection->getMethods(); |
|
| 24 | 8 | $methodsArray = []; |
|
| 25 | 8 | foreach ($methods as $method) { |
|
| 26 | 8 | if (!in_array($method->getName(), self::UNSAFE_METHODS, true)) { |
|
|
|
|||
| 27 | 8 | $methodsArray[] = ProxyMethodGenerator::generateMethodString($method); |
|
| 28 | } |
||
| 29 | } |
||
| 30 | |||
| 31 | 8 | return sprintf( |
|
| 32 | 8 | self::$template, |
|
| 33 | 8 | $classWillBeEtended, |
|
| 34 | 8 | ProxyInterface::class, |
|
| 35 | 8 | ProxyTrait::class, |
|
| 36 | 8 | implode(PHP_EOL, $methodsArray) |
|
| 37 | ); |
||
| 38 | } |
||
| 39 | } |
||
| 40 |