Make condition easier to read; no change in logic

This commit is contained in:
Fonata
2021-04-02 22:19:09 +02:00
committed by Fonata
parent 45f079b5dd
commit abae91a1a2

View File

@@ -731,9 +731,8 @@ class Csv {
} else { } else {
$enclosed = false; $enclosed = false;
} }
// end of field/row/csv // end of field/row/csv
} elseif (($ch === $this->delimiter || $ch == "\n" || $ch == "\r" || $ch === false) && !$enclosed) { } elseif ((in_array($ch, [$this->delimiter, "\n", "\r", false], true)) && !$enclosed) {
$key = !empty($head[$col]) ? $head[$col] : $col; $key = !empty($head[$col]) ? $head[$col] : $col;
$row[$key] = $was_enclosed ? $current : trim($current); $row[$key] = $was_enclosed ? $current : trim($current);
$current = ''; $current = '';