Conditions | 6 |
Paths | 6 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
59 | 21 | public static function formatValue($value, $quote = true) |
|
60 | { |
||
61 | 21 | if (null === $value) { |
|
62 | 2 | return 'null'; |
|
63 | } |
||
64 | |||
65 | 20 | if (is_bool($value)) { |
|
66 | 7 | return $value ? 'true' : 'false'; |
|
67 | } |
||
68 | |||
69 | 15 | if (is_string($value)) { |
|
70 | 11 | $q = $quote ? '"' : ''; |
|
71 | |||
72 | 11 | return $q.$value.$q; |
|
73 | } |
||
74 | |||
75 | 4 | return (string) $value; |
|
76 | } |
||
77 | |||
82 |