Skip to content

Commit

Permalink
Refactor name.
Browse files Browse the repository at this point in the history
  • Loading branch information
martineiber committed Jul 16, 2024
1 parent 3f400fb commit 34ae1c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/Asset/Service/ExecutionEngine/CsvService.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ public function generateCsvFile(ExportAssetParameter $exportAssetParameter): str
return $this->getTempFilePath($jobRun->getId(), self::CSV_FILE_PATH);
}

public function getCsvFile(int $id, ColumnCollection $configuration, array $settings): string
public function getCsvFile(int $id, ColumnCollection $columnCollection, array $settings): string
{
$storage = $this->storageResolver->get(StorageDirectories::TEMP->value);
$file = $this->getTempFileName($id, self::CSV_FILE_NAME);

try {
if (!$storage->fileExists($file)) {
$headers = $this->getHeaders($configuration, $settings);
$headers = $this->getHeaders($columnCollection, $settings);
$storage->write(
$file,
implode($settings[Csv::SETTINGS_DELIMITER->value] ?? ',', $headers). Csv::NEW_LINE->value
Expand Down Expand Up @@ -125,15 +125,15 @@ private function encodeFunc(?string $value): string
return '"' . $value . '"';
}

private function getHeaders(ColumnCollection $configuration, array $settings): array
private function getHeaders(ColumnCollection $columnCollection, array $settings): array
{
$header = $settings[Csv::SETTINGS_HEADER->value] ?? Csv::SETTINGS_HEADER_NO_HEADER->value;
if ($header === Csv::SETTINGS_HEADER_NO_HEADER->value) {
return [];
}

return $this->gridService->getColumnKeys(
$configuration,
$columnCollection,
$header === Csv::SETTINGS_HEADER_NAME->value
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Asset/Service/ExecutionEngine/CsvServiceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ interface CsvServiceInterface

public const CSV_FILE_PATH = PIMCORE_SYSTEM_TEMP_DIRECTORY . '/' . self::CSV_FILE_NAME;

public function getCsvFile(int $id, ColumnCollection $configuration, array $settings): string;
public function getCsvFile(int $id, ColumnCollection $columnCollection, array $settings): string;

public function addData(string $filePath, string $delimiter, array $data): void;

Expand Down

0 comments on commit 34ae1c4

Please sign in to comment.