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 59b4051 commit 3f400fb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ public function __invoke(CsvCreationMessage $message): void
}

$settings = $this->extractConfigFieldFromJobStepConfig($message, 'settings');
$configuration = $this->gridService->getConfigurationFromArray(
$columnCollection = $this->gridService->getConfigurationFromArray(
$this->extractConfigFieldFromJobStepConfig($message, 'configuration')
);

$csv = $this->csvService->getCsvFile($jobRun->getId(), $configuration, $settings);
$csv = $this->csvService->getCsvFile($jobRun->getId(), $columnCollection, $settings);

if (!$csv) {
$this->abort($this->getAbortData(
Expand All @@ -125,7 +125,7 @@ public function __invoke(CsvCreationMessage $message): void
}

$assetData = $this->gridService->getGridValuesForElement(
$configuration,
$columnCollection,
$asset,
ElementTypes::TYPE_ASSET
);
Expand Down
12 changes: 6 additions & 6 deletions src/Grid/Service/GridService.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ public function getAssetGrid(GridParameter $gridParameter): Collection
* @throws InvalidArgumentException
*/
public function getGridDataForElement(
ColumnCollection $configuration,
ColumnCollection $columnCollection,
ElementInterface $element,
string $elementType
): array {
$data = [];
foreach ($configuration->getColumns() as $column) {
foreach ($columnCollection->getColumns() as $column) {
// move this to the resolver
if (!$this->supports($column, $elementType)) {
continue;
Expand All @@ -130,11 +130,11 @@ public function getGridDataForElement(
}

public function getGridValuesForElement(
ColumnCollection $configuration,
ColumnCollection $columnCollection,
ElementInterface $element,
string $elementType
): array {
$data = $this->getGridDataForElement($configuration, $element, $elementType);
$data = $this->getGridDataForElement($columnCollection, $element, $elementType);

return array_map(
static fn (ColumnData $columnData) => $columnData->getValue(),
Expand Down Expand Up @@ -205,13 +205,13 @@ public function getConfigurationFromArray(array $config): ColumnCollection
return new ColumnCollection($columns);
}

public function getColumnKeys(ColumnCollection $configuration, bool $withGroup = false): array
public function getColumnKeys(ColumnCollection $columnCollection, bool $withGroup = false): array
{
return array_map(
static function (Column $column) use ($withGroup) {
return $column->getKey() . ($withGroup ? '~' . $column->getGroup() : '');
},
$configuration->getColumns()
$columnCollection->getColumns()
);
}

Expand Down
6 changes: 3 additions & 3 deletions src/Grid/Service/GridServiceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ public function getDataObjectGridColumns(ClassDefinition $classDefinition): Colu
* @throws InvalidArgumentException
*/
public function getGridDataForElement(
ColumnCollection $configuration,
ColumnCollection $columnCollection,
ElementInterface $element,
string $elementType
): array;

public function getGridValuesForElement(
ColumnCollection $configuration,
ColumnCollection $columnCollection,
ElementInterface $element,
string $elementType
): array;
Expand All @@ -57,5 +57,5 @@ public function getConfigurationFromArray(array $config): ColumnCollection;

public function getAssetGrid(GridParameter $gridParameter): Collection;

public function getColumnKeys(ColumnCollection $configuration, bool $withGroup = false): array;
public function getColumnKeys(ColumnCollection $columnCollection, bool $withGroup = false): array;
}

0 comments on commit 3f400fb

Please sign in to comment.