Conditions | 3 |
Paths | 4 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
27 | 7 | protected static function doGenerate(\ReflectionMethod $method): string |
|
28 | { |
||
29 | 7 | $originalReturnType = $method->getReturnType(); |
|
30 | 7 | $allowsNull = $originalReturnType->allowsNull() |
|
31 | 1 | ? '?' |
|
32 | 7 | : ''; |
|
33 | |||
34 | 7 | $returnType = 'self' === $originalReturnType->getName() |
|
35 | 1 | ? $method->getDeclaringClass()->name |
|
36 | 7 | : $originalReturnType->getName(); |
|
37 | |||
38 | 7 | return sprintf( |
|
39 | 7 | self::TEMPLATE, |
|
40 | $allowsNull, |
||
41 | $returnType |
||
42 | ); |
||
43 | } |
||
44 | } |
||
45 |