Skip to content

Commit f058abf

Browse files
committed
[JsonEncoder] [FrameworkBundle] Fix service definition
1 parent 981c3a2 commit f058abf

File tree

1 file changed

+44
-42
lines changed

1 file changed

+44
-42
lines changed

src/Symfony/Bundle/FrameworkBundle/Resources/config/json_encoder.php

Lines changed: 44 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -45,49 +45,51 @@
4545
->alias(JsonDecoder::class, 'json_encoder.decoder')
4646

4747
// metadata
48-
->stack('json_encoder.encode.property_metadata_loader', [
49-
inline_service(EncodeAttributePropertyMetadataLoader::class)
50-
->args([
51-
service('.inner'),
52-
tagged_locator('json_encoder.normalizer'),
53-
service('type_info.resolver'),
54-
]),
55-
inline_service(EncodeDateTimeTypePropertyMetadataLoader::class)
56-
->args([
57-
service('.inner'),
58-
]),
59-
inline_service(GenericTypePropertyMetadataLoader::class)
60-
->args([
61-
service('.inner'),
62-
service('type_info.type_context_factory'),
63-
]),
64-
inline_service(PropertyMetadataLoader::class)
65-
->args([
66-
service('type_info.resolver'),
67-
]),
68-
])
48+
->set('json_encoder.encode.property_metadata_loader', PropertyMetadataLoader::class)
49+
->args([
50+
service('type_info.resolver'),
51+
])
52+
->set('.json_encoder.encode.property_metadata_loader.generic', GenericTypePropertyMetadataLoader::class)
53+
->decorate('json_encoder.encode.property_metadata_loader')
54+
->args([
55+
service('.inner'),
56+
service('type_info.type_context_factory'),
57+
])
58+
->set('.json_encoder.encode.property_metadata_loader.date_time', EncodeDateTimeTypePropertyMetadataLoader::class)
59+
->decorate('json_encoder.encode.property_metadata_loader')
60+
->args([
61+
service('.inner'),
62+
])
63+
->set('.json_encoder.encode.property_metadata_loader.attribute', EncodeAttributePropertyMetadataLoader::class)
64+
->decorate('json_encoder.encode.property_metadata_loader')
65+
->args([
66+
service('.inner'),
67+
tagged_locator('json_encoder.normalizer'),
68+
service('type_info.resolver'),
69+
])
6970

70-
->stack('json_encoder.decode.property_metadata_loader', [
71-
inline_service(DecodeAttributePropertyMetadataLoader::class)
72-
->args([
73-
service('.inner'),
74-
tagged_locator('json_encoder.denormalizer'),
75-
service('type_info.resolver'),
76-
]),
77-
inline_service(DecodeDateTimeTypePropertyMetadataLoader::class)
78-
->args([
79-
service('.inner'),
80-
]),
81-
inline_service(GenericTypePropertyMetadataLoader::class)
82-
->args([
83-
service('.inner'),
84-
service('type_info.type_context_factory'),
85-
]),
86-
inline_service(PropertyMetadataLoader::class)
87-
->args([
88-
service('type_info.resolver'),
89-
]),
90-
])
71+
->set('json_encoder.decode.property_metadata_loader', PropertyMetadataLoader::class)
72+
->args([
73+
service('type_info.resolver'),
74+
])
75+
->set('.json_encoder.decode.property_metadata_loader.generic', GenericTypePropertyMetadataLoader::class)
76+
->decorate('json_encoder.decode.property_metadata_loader')
77+
->args([
78+
service('.inner'),
79+
service('type_info.type_context_factory'),
80+
])
81+
->set('.json_encoder.decode.property_metadata_loader.date_time', DecodeDateTimeTypePropertyMetadataLoader::class)
82+
->decorate('json_encoder.decode.property_metadata_loader')
83+
->args([
84+
service('.inner'),
85+
])
86+
->set('.json_encoder.decode.property_metadata_loader.attribute', DecodeAttributePropertyMetadataLoader::class)
87+
->decorate('json_encoder.decode.property_metadata_loader')
88+
->args([
89+
service('.inner'),
90+
tagged_locator('json_encoder.normalizer'),
91+
service('type_info.resolver'),
92+
])
9193

9294
// normalizers/denormalizers
9395
->set('json_encoder.normalizer.date_time', DateTimeNormalizer::class)

0 commit comments

Comments
 (0)