Skip to content

Commit

Permalink
Merge pull request #29 from dmt-software/2.1
Browse files Browse the repository at this point in the history
#28: fix handling csv key-value pairs 
closes #28
  • Loading branch information
proggeler authored Dec 14, 2023
2 parents 2f935fa + 145a386 commit 7aa77ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Decorators/Handler/GenericHandlerDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function decorate($currentRow): object
} elseif ($type === self::TYPE_JSON) {
$currentRow = json_decode($currentRow) ?? false;
} elseif ($type === self::TYPE_CSV) {
$currentKeys = array_map('sprintf', array_fill_keys($currentRow, 'col%d'), range(1, count($currentRow)));
$currentKeys = array_map('sprintf', array_fill_keys(array_keys($currentRow), 'col%d'), range(1, count($currentRow)));
$currentRow = new ArrayObject(array_combine($currentKeys, $currentRow), ArrayObject::ARRAY_AS_PROPS);
}

Expand Down

0 comments on commit 7aa77ae

Please sign in to comment.