@@ -13,15 +13,12 @@ |
||
| 13 | 13 | namespace CSVelte; |
| 14 | 14 | |
| 15 | 15 | use CSVelte\Contract\Streamable; |
| 16 | - |
|
| 17 | 16 | use CSVelte\Exception\SnifferException; |
| 18 | 17 | use CSVelte\Sniffer\SniffDelimiterByConsistency; |
| 19 | 18 | use CSVelte\Sniffer\SniffDelimiterByDistribution; |
| 20 | 19 | use CSVelte\Sniffer\SniffLineTerminatorByCount; |
| 21 | 20 | use CSVelte\Sniffer\SniffQuoteAndDelimByAdjacency; |
| 22 | -use Noz\Collection\Collection; |
|
| 23 | 21 | use function Noz\to_array; |
| 24 | -use RuntimeException; |
|
| 25 | 22 | |
| 26 | 23 | use function Noz\collect; |
| 27 | 24 | use function Stringy\create as s; |
@@ -35,9 +35,9 @@ |
||
| 35 | 35 | // in this case we really only care about newlines so we pass in a comma as the delim |
| 36 | 36 | $str = $this->replaceQuotedSpecialChars($data, ','); |
| 37 | 37 | $eols = [ |
| 38 | - static::EOL_WINDOWS => "\r\n", // 0x0D - 0x0A - Windows, DOS OS/2 |
|
| 39 | - static::EOL_UNIX => "\n", // 0x0A - - Unix, OSX |
|
| 40 | - static::EOL_OTHER => "\r", // 0x0D - - Other |
|
| 38 | + static::EOL_WINDOWS => "\r\n", // 0x0D - 0x0A - Windows, DOS OS/2 |
|
| 39 | + static::EOL_UNIX => "\n", // 0x0A - - Unix, OSX |
|
| 40 | + static::EOL_OTHER => "\r", // 0x0D - - Other |
|
| 41 | 41 | ]; |
| 42 | 42 | |
| 43 | 43 | $curCount = 0; |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | if (is_null($eol)) { |
| 69 | 69 | $eol = "\r\n|\r|\n"; |
| 70 | 70 | } |
| 71 | - return preg_replace_callback('/([\'"])(.*)\1/imsU', function ($matches) use ($delim, $eol) { |
|
| 71 | + return preg_replace_callback('/([\'"])(.*)\1/imsU', function($matches) use ($delim, $eol) { |
|
| 72 | 72 | $ret = preg_replace("/({$eol})/", self::PLACEHOLDER_NEWLINE, $matches[0]); |
| 73 | 73 | if (!is_null($delim)) { |
| 74 | 74 | $ret = str_replace($delim, self::PLACEHOLDER_DELIM, $ret); |