Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3.0416 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
42 | 3 | public static function escapeEnclosure(array $data, string $enclosure): array |
|
43 | { |
||
44 | 3 | foreach ($data as $key => $value) { |
|
45 | 3 | if (\is_array($value)) { |
|
46 | $data[$key] = self::escapeEnclosure($value, $enclosure); |
||
47 | } else { |
||
48 | 3 | $data[$key] = str_replace($enclosure, str_repeat($enclosure, 2), $value); |
|
49 | } |
||
50 | } |
||
51 | |||
52 | 3 | return $data; |
|
53 | } |
||
55 |