[BUGFIX] Create SkillSet entity from array

This commit is contained in:
Markus Klein 2023-07-07 14:10:16 +02:00
parent ceabcd7482
commit b53dde14e2
2 changed files with 6 additions and 1 deletions

View file

@ -130,7 +130,7 @@ class SkillSet
$skillSetsJson = json_decode($body, true); $skillSetsJson = json_decode($body, true);
$skillSets = []; $skillSets = [];
foreach ($skillSetsJson as $skillSet) { foreach ($skillSetsJson as $skillSet) {
$skillSets[] = Entity::createFromJson($skillSet, $this->settings); $skillSets[] = Entity::createFromArray($skillSet, $this->settings);
} }
return $skillSets; return $skillSets;

View file

@ -113,4 +113,9 @@ class SkillSet
{ {
return new SkillSet(json_decode($json, true), $settings); return new SkillSet(json_decode($json, true), $settings);
} }
public static function createFromArray(array $data, Settings $settings): SkillSet
{
return new SkillSet($data, $settings);
}
} }