From 4a001556d8368d5dd453f338c0ec994755004f38 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 3 Oct 2019 16:34:47 +0930 Subject: [PATCH] Ensure primary resources are returned in the correct order --- src/Serializer.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Serializer.php b/src/Serializer.php index 7190cd5..694f750 100644 --- a/src/Serializer.php +++ b/src/Serializer.php @@ -242,7 +242,9 @@ final class Serializer 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); }