Skip to content

Commit

Permalink
only trim tariffName
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasVHG committed Aug 6, 2024
1 parent 2114f6b commit e7efbb1
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ private function getSchemaErrors(array $priceInfos): array
$errors = [];
$nameMatrix = [];

$priceInfos = $this->trimArrayValues($priceInfos);
$priceInfos = $this->trimTariffName($priceInfos); //$this->trimArrayValues($priceInfos);

foreach ($priceInfos as $index => $priceInfo) {
foreach ($priceInfo['name'] as $language => $name) {
Expand All @@ -59,15 +59,15 @@ private function getSchemaErrors(array $priceInfos): array
return $errors;
}

private function trimArrayValues(array $array): array
private function trimTariffName(array $priceInfos): array
{
foreach ($array as $key => $value) {
if (is_array($value)) {
$array[$key] = $this->trimArrayValues($value);
} else {
$array[$key] = is_string($value) ? trim($value) : $value;
foreach ($priceInfos as $key => $tariff) {
if (array_key_exists('name', $tariff)) {
foreach ($tariff['name'] as $language => $name) {
$priceInfos[$key]['name'][$language] = trim($priceInfos[$key]['name'][$language]);
}
}
}
return $array;
return $priceInfos;
}
}

0 comments on commit e7efbb1

Please sign in to comment.