Conditions | 4 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
36 | 8 | protected function process($value, string $type) |
|
37 | { |
||
38 | 8 | if ($type === 'integer') { |
|
39 | 2 | return (int) $value; |
|
40 | } |
||
41 | |||
42 | 6 | if ($type === 'float') { |
|
43 | 2 | return (float) $value; |
|
44 | } |
||
45 | |||
46 | 4 | if ($type === 'boolean') { |
|
47 | 2 | return (bool) $value; |
|
48 | } |
||
49 | |||
50 | 2 | return (string) $value; |
|
51 | } |
||
52 | |||
60 | } |