Conditions | 1 |
Paths | 1 |
Total Lines | 9 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
13 | 12 | private function sanitize() |
|
14 | { |
||
15 | 12 | $fileWithoutEmptyLine = preg_replace('/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/', '\n', $this->fileContent); |
|
16 | 12 | $cleanedCsvAmounts = preg_replace('/,(?=[^\"]*\"[^\"]*(?:\"[^\"]*\"[^\"]*)*$)/', '', $fileWithoutEmptyLine); |
|
17 | 12 | $cleanedCsvAmounts = preg_replace('/[\"]+/', '', $cleanedCsvAmounts); |
|
18 | |||
19 | 12 | $lines = explode(PHP_EOL, $cleanedCsvAmounts); |
|
20 | |||
21 | 12 | return $lines; |
|
22 | } |
||
42 |