Conditions | 6 |
Paths | 6 |
Total Lines | 22 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
46 | 16 | public static function determine($value): string |
|
47 | { |
||
48 | 16 | $type = \gettype($value); |
|
49 | |||
50 | 16 | switch ($type) { |
|
51 | 16 | case 'object': |
|
52 | 2 | return \get_class($value); |
|
53 | |||
54 | 16 | case 'integer': |
|
55 | 16 | return 'int'; |
|
56 | |||
57 | 2 | case 'boolean': |
|
58 | 2 | return 'bool'; |
|
59 | |||
60 | 2 | case 'NULL': |
|
61 | 2 | return 'null'; |
|
62 | |||
63 | 2 | case 'double': |
|
64 | 2 | return 'float'; |
|
65 | |||
66 | default: |
||
67 | 2 | return $type; |
|
68 | } |
||
71 |