Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
29 | 3 | public static function fromPhpTypeReflection(?ReflectionType $phpTypeReflection): Type |
|
30 | { |
||
31 | 3 | if ($phpTypeReflection === null) { |
|
32 | 3 | return self::mixedPhpType(); |
|
33 | } |
||
34 | |||
35 | 3 | if ($phpTypeReflection instanceof ReflectionNamedType) { |
|
36 | 3 | return new Type( |
|
37 | 3 | $phpTypeReflection->getName(), |
|
38 | 3 | $phpTypeReflection->allowsNull(), |
|
39 | 3 | ); |
|
40 | } |
||
41 | |||
42 | 3 | return new Type( |
|
43 | 3 | (string) $phpTypeReflection, |
|
44 | 3 | $phpTypeReflection->allowsNull(), |
|
45 | 3 | ); |
|
48 |