Conditions | 4 |
Paths | 4 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
37 | private function determineType(Const_ $constant): ?string |
||
38 | { |
||
39 | if ($constant->value instanceof Scalar) { |
||
40 | return self::$types[\gettype($constant->value->value)]; |
||
41 | } |
||
42 | if ($constant->value instanceof ConstFetch) { |
||
43 | if (\in_array($constant->value->name->parts[0], ['true', 'false'], true)) { |
||
44 | return 'bool'; |
||
45 | } |
||
46 | } |
||
47 | return null; // It's an expression |
||
48 | } |
||
50 |