Fix usage

modifié:         core/lib/Thelia/Core/FileFormat/Formatting/Formatter/CSVFormatter.php
This commit is contained in:
Benjamin Perche
2014-08-01 16:30:06 +02:00
parent 81454c047d
commit df27aff534

View File

@@ -84,7 +84,7 @@ class CSVFormatter extends AbstractFormatter
$delimiterLength = strlen($this->delimiter); $delimiterLength = strlen($this->delimiter);
$lineReturnLength = strlen($this->lineReturn); $lineReturnLength = strlen($this->lineReturn);
if ($firstRow === null) { if ($firstRow === false) {
return ""; return "";
} }
@@ -93,7 +93,6 @@ class CSVFormatter extends AbstractFormatter
*/ */
$this->checkOrders($firstRow); $this->checkOrders($firstRow);
if (false !== $firstRow) {
$rawKeys = array_keys($firstRow); $rawKeys = array_keys($firstRow);
$keys = []; $keys = [];
@@ -128,10 +127,6 @@ class CSVFormatter extends AbstractFormatter
$string = substr($string,0, -$delimiterLength) . $this->lineReturn; $string = substr($string,0, -$delimiterLength) . $this->lineReturn;
} }
} else {
$lineReturnLength = 0;
}
return substr($string, 0, -$lineReturnLength); return substr($string, 0, -$lineReturnLength);
} }