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 |
||
40 | 2 | public static function escapeEnclosure(array $data, string $enclosure): array |
|
41 | { |
||
42 | 2 | foreach ($data as $key => $value) { |
|
43 | 2 | if (\is_array($value)) { |
|
44 | $data[$key] = self::escapeEnclosure($value, $enclosure); |
||
45 | } else { |
||
46 | 2 | $data[$key] = \str_replace($enclosure, \str_repeat($enclosure, 2), $value); |
|
47 | } |
||
48 | } |
||
49 | |||
50 | 2 | return $data; |
|
51 | } |
||
53 |