Ensure primary resources are returned in the correct order

This commit is contained in:
Toby Zerner 2019-10-03 16:34:47 +09:30
parent 606a79a0cf
commit 4a001556d8
1 changed files with 3 additions and 1 deletions

View File

@ -242,7 +242,9 @@ final class Serializer
public function primary(): array public function primary(): array
{ {
$primary = array_values(array_intersect_key($this->map, array_flip($this->primary))); $primary = array_map(function ($key) {
return $this->map[$key];
}, $this->primary);
return $this->resourceObjects($primary); return $this->resourceObjects($primary);
} }