Encapsulate the fieldmapping data in the importjob further

This commit is contained in:
Jan Böhmer 2025-09-21 17:41:56 +02:00
parent eda6deff47
commit 16126c4000
3 changed files with 39 additions and 17 deletions

View file

@ -47,7 +47,7 @@ readonly class FieldMappingDTO
* Create a FieldMappingDTO from legacy array format.
* @param array{field: string, providers: string[], priority?: int} $data
*/
public static function fromArray(array $data): self
public static function fromSerializableArray(array $data): self
{
return new self(
field: $data['field'],
@ -60,7 +60,7 @@ readonly class FieldMappingDTO
* Convert this DTO to the legacy array format for backwards compatibility.
* @return array{field: string, providers: string[], priority: int}
*/
public function toArray(): array
public function toSerializableArray(): array
{
return [
'field' => $this->field,
@ -89,4 +89,4 @@ readonly class FieldMappingDTO
return substr($this->field, 0, -4);
}
}
}