Skip to content

Commit

Permalink
Apply php-cs-fixer changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mcop1 authored and github-actions[bot] committed Nov 22, 2024
1 parent 3d28325 commit 8882b01
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/DataSource/Interpreter/CsvFileInterpreter.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ protected function doInterpretFileAndCallProcessRow(string $path): void
if ($this->skipFirstRow) {
//load first row and ignore it
$data = fgetcsv($handle, 0, $this->delimiter, $this->enclosure, $this->escape);
if($this->saveHeaderName){
if ($this->saveHeaderName) {
$header = $data;
}
}

while (($data = fgetcsv($handle, 0, $this->delimiter, $this->enclosure, $this->escape)) !== false) {
if($header !== null){
if ($header !== null) {
$data = array_combine($header, $data);
}
$this->processImportRow($data);
Expand Down Expand Up @@ -109,12 +109,12 @@ public function previewData(string $path, int $recordNumber = 0, array $mappedCo
//load first row and ignore it
$data = fgetcsv($handle, 0, $this->delimiter, $this->enclosure, $this->escape);

if($this->saveHeaderName){
if ($this->saveHeaderName) {
$header = $data;
foreach ($data as $index => $columnHeader) {
$columns[$columnHeader] = trim($columnHeader);
}
}else{
} else {
foreach ($data as $index => $columnHeader) {
$columns[$index] = trim($columnHeader) . " [$index]";
}
Expand All @@ -123,7 +123,7 @@ public function previewData(string $path, int $recordNumber = 0, array $mappedCo

$previousData = null;
while ($readRecordNumber < $recordNumber && ($data = fgetcsv($handle, 0, $this->delimiter, $this->enclosure, $this->escape)) !== false) {
if($header !== null){
if ($header !== null) {
$data = array_combine($header, $data);
}
$previousData = $data;
Expand Down

0 comments on commit 8882b01

Please sign in to comment.