Skip to content
This repository was archived by the owner on Oct 24, 2023. It is now read-only.

Commit ea50790

Browse files
author
Jens Schulze
committed
fix(LocalizedString): fix array conversion of locales for LocalizedString
1 parent feb3729 commit ea50790

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/Model/Common/LocalizedString.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,21 +127,21 @@ public function __toString()
127127
*/
128128
public function toArray()
129129
{
130-
return $this->values;
130+
$values = $this->values;
131+
132+
$data = [];
133+
foreach ($values as $key => $value) {
134+
$data[str_replace('_', '-', $key)] = $value;
135+
}
136+
return $data;
131137
}
132138

133139
/**
134140
* @return array
135141
*/
136142
public function jsonSerialize()
137143
{
138-
$values = $this->toArray();
139-
140-
$data = [];
141-
foreach ($values as $key => $value) {
142-
$data[str_replace('_', '-', $key)] = $value;
143-
}
144-
return $data;
144+
return $this->toArray();
145145
}
146146

147147
/**

0 commit comments

Comments
 (0)