@@ -973,11 +973,7 @@ public function register(): void
973
973
);
974
974
});
975
975
976
- $ this ->app ->bind (SerializerInterface::class, Serializer::class);
977
- $ this ->app ->bind (NormalizerInterface::class, Serializer::class);
978
- $ this ->app ->singleton (Serializer::class, function (Application $ app ) {
979
- /** @var ConfigRepository */
980
- $ config = $ app ['config ' ];
976
+ $ this ->app ->singleton ('api_platform_normalizer_list ' , function (Application $ app ) {
981
977
$ list = new \SplPriorityQueue ();
982
978
$ list ->insert ($ app ->make (HydraEntrypointNormalizer::class), -800 );
983
979
$ list ->insert ($ app ->make (HydraPartialCollectionViewNormalizer::class), -800 );
@@ -1011,14 +1007,20 @@ public function register(): void
1011
1007
$ list ->insert ($ app ->make (GraphQlRuntimeExceptionNormalizer::class), -780 );
1012
1008
}
1013
1009
1010
+ return $ list ;
1011
+ });
1012
+
1013
+ $ this ->app ->bind (SerializerInterface::class, Serializer::class);
1014
+ $ this ->app ->bind (NormalizerInterface::class, Serializer::class);
1015
+ $ this ->app ->singleton (Serializer::class, function (Application $ app ) {
1014
1016
// TODO: unused + implement hal/jsonapi ?
1015
1017
// $list->insert($dataUriNormalizer, -920);
1016
1018
// $list->insert($unwrappingDenormalizer, 1000);
1017
1019
// $list->insert($jsonserializableNormalizer, -900);
1018
1020
// $list->insert($uuidDenormalizer, -895); //Todo ramsey uuid support ?
1019
1021
1020
1022
return new Serializer (
1021
- iterator_to_array ($ list ),
1023
+ iterator_to_array ($ app -> make ( ' api_platform_normalizer_list ' ) ),
1022
1024
[
1023
1025
new JsonEncoder ('json ' ),
1024
1026
$ app ->make (JsonEncoder::class),
0 commit comments