|
13 | 13 |
|
14 | 14 | namespace Symfony\Component\DependencyInjection\Loader\Configurator; |
15 | 15 |
|
| 16 | +use ApiPlatform\Metadata\IdentifiersExtractor; |
| 17 | +use ApiPlatform\Metadata\IdentifiersExtractorInterface; |
| 18 | +use ApiPlatform\Metadata\IriConverterInterface; |
| 19 | +use ApiPlatform\Metadata\Operation\DashPathSegmentNameGenerator; |
| 20 | +use ApiPlatform\Metadata\Operation\UnderscorePathSegmentNameGenerator; |
| 21 | +use ApiPlatform\Metadata\ResourceClassResolver; |
| 22 | +use ApiPlatform\Metadata\ResourceClassResolverInterface; |
| 23 | +use ApiPlatform\Metadata\UriVariablesConverter; |
| 24 | +use ApiPlatform\Metadata\UriVariableTransformer\ApiResourceUriVariableTransformer; |
| 25 | +use ApiPlatform\Metadata\UriVariableTransformer\DateTimeUriVariableTransformer; |
| 26 | +use ApiPlatform\Metadata\UriVariableTransformer\IntegerUriVariableTransformer; |
| 27 | +use ApiPlatform\Metadata\UrlGeneratorInterface; |
| 28 | +use ApiPlatform\Metadata\Util\Inflector; |
| 29 | +use ApiPlatform\Serializer\ConstraintViolationListNormalizer; |
| 30 | +use ApiPlatform\Serializer\Filter\GroupFilter; |
| 31 | +use ApiPlatform\Serializer\Filter\PropertyFilter; |
| 32 | +use ApiPlatform\Serializer\ItemNormalizer; |
| 33 | +use ApiPlatform\Serializer\Mapping\Factory\ClassMetadataFactory; |
| 34 | +use ApiPlatform\Serializer\Mapping\Loader\PropertyMetadataLoader; |
| 35 | +use ApiPlatform\Serializer\Parameter\SerializerFilterParameterProvider; |
| 36 | +use ApiPlatform\Serializer\SerializerContextBuilder; |
| 37 | +use ApiPlatform\Serializer\SerializerFilterContextBuilder; |
| 38 | +use ApiPlatform\State\ErrorProvider; |
| 39 | +use ApiPlatform\State\SerializerContextBuilderInterface; |
| 40 | +use ApiPlatform\Symfony\Action\NotExposedAction; |
| 41 | +use ApiPlatform\Symfony\Action\NotFoundAction; |
| 42 | +use ApiPlatform\Symfony\Routing\ApiLoader; |
| 43 | +use ApiPlatform\Symfony\Routing\IriConverter; |
| 44 | +use ApiPlatform\Symfony\Routing\Router; |
| 45 | +use ApiPlatform\Symfony\Routing\SkolemIriConverter; |
| 46 | +use Negotiation\Negotiator; |
| 47 | +use Symfony\Component\Serializer\Mapping\Factory\CacheClassMetadataFactory; |
| 48 | + |
16 | 49 | return function (ContainerConfigurator $container) { |
17 | 50 | $services = $container->services(); |
18 | 51 |
|
19 | | - $services->set('api_platform.action.not_found', 'ApiPlatform\Symfony\Action\NotFoundAction') |
| 52 | + $services->set('api_platform.action.not_found', NotFoundAction::class) |
20 | 53 | ->public(); |
21 | 54 |
|
22 | | - $services->alias('ApiPlatform\Symfony\Action\NotFoundAction', 'api_platform.action.not_found') |
| 55 | + $services->alias(NotFoundAction::class, 'api_platform.action.not_found') |
23 | 56 | ->public(); |
24 | 57 |
|
25 | | - $services->set('api_platform.action.not_exposed', 'ApiPlatform\Symfony\Action\NotExposedAction') |
| 58 | + $services->set('api_platform.action.not_exposed', NotExposedAction::class) |
26 | 59 | ->public(); |
27 | 60 |
|
28 | | - $services->alias('ApiPlatform\Symfony\Action\NotExposedAction', 'api_platform.action.not_exposed') |
| 61 | + $services->alias(NotExposedAction::class, 'api_platform.action.not_exposed') |
29 | 62 | ->public(); |
30 | 63 |
|
31 | 64 | $services->alias('api_platform.serializer', 'serializer'); |
|
34 | 67 |
|
35 | 68 | $services->alias('api_platform.property_info', 'property_info'); |
36 | 69 |
|
37 | | - $services->set('api_platform.negotiator', 'Negotiation\Negotiator'); |
| 70 | + $services->set('api_platform.negotiator', Negotiator::class); |
38 | 71 |
|
39 | | - $services->set('api_platform.resource_class_resolver', 'ApiPlatform\Metadata\ResourceClassResolver') |
| 72 | + $services->set('api_platform.resource_class_resolver', ResourceClassResolver::class) |
40 | 73 | ->args([service('api_platform.metadata.resource.name_collection_factory')]); |
41 | 74 |
|
42 | | - $services->alias('ApiPlatform\Metadata\ResourceClassResolverInterface', 'api_platform.resource_class_resolver'); |
| 75 | + $services->alias(ResourceClassResolverInterface::class, 'api_platform.resource_class_resolver'); |
43 | 76 |
|
44 | | - $services->alias('ApiPlatform\Metadata\UrlGeneratorInterface', 'api_platform.router'); |
| 77 | + $services->alias(UrlGeneratorInterface::class, 'api_platform.router'); |
45 | 78 |
|
46 | | - $services->set('api_platform.router', 'ApiPlatform\Symfony\Routing\Router') |
| 79 | + $services->set('api_platform.router', Router::class) |
47 | 80 | ->args([ |
48 | 81 | service('router'), |
49 | 82 | '%api_platform.url_generation_strategy%', |
50 | 83 | ]); |
51 | 84 |
|
52 | | - $services->set('api_platform.serializer.context_builder', 'ApiPlatform\Serializer\SerializerContextBuilder') |
| 85 | + $services->set('api_platform.serializer.context_builder', SerializerContextBuilder::class) |
53 | 86 | ->arg(0, service('api_platform.metadata.resource.metadata_collection_factory')) |
54 | 87 | ->arg('$debug', '%kernel.debug%'); |
55 | 88 |
|
56 | | - $services->set('api_platform.serializer.filter_parameter_provider', 'ApiPlatform\Serializer\Parameter\SerializerFilterParameterProvider') |
| 89 | + $services->set('api_platform.serializer.filter_parameter_provider', SerializerFilterParameterProvider::class) |
57 | 90 | ->args([service('api_platform.filter_locator')]) |
58 | 91 | ->tag('api_platform.parameter_provider', ['key' => 'api_platform.serializer.filter_parameter_provider', 'priority' => -895]); |
59 | 92 |
|
60 | | - $services->alias('ApiPlatform\State\SerializerContextBuilderInterface', 'api_platform.serializer.context_builder'); |
| 93 | + $services->alias(SerializerContextBuilderInterface::class, 'api_platform.serializer.context_builder'); |
61 | 94 |
|
62 | | - $services->set('api_platform.serializer.context_builder.filter', 'ApiPlatform\Serializer\SerializerFilterContextBuilder') |
| 95 | + $services->set('api_platform.serializer.context_builder.filter', SerializerFilterContextBuilder::class) |
63 | 96 | ->decorate('api_platform.serializer.context_builder', null, 0) |
64 | 97 | ->args([ |
65 | 98 | service('api_platform.metadata.resource.metadata_collection_factory'), |
66 | 99 | service('api_platform.filter_locator'), |
67 | 100 | service('api_platform.serializer.context_builder.filter.inner'), |
68 | 101 | ]); |
69 | 102 |
|
70 | | - $services->set('api_platform.serializer.property_filter', 'ApiPlatform\Serializer\Filter\PropertyFilter') |
| 103 | + $services->set('api_platform.serializer.property_filter', PropertyFilter::class) |
71 | 104 | ->abstract() |
72 | 105 | ->arg('$parameterName', 'properties') |
73 | 106 | ->arg('$overrideDefaultProperties', false) |
74 | 107 | ->arg('$whitelist', null) |
75 | 108 | ->arg('$nameConverter', service('api_platform.name_converter')->ignoreOnInvalid()); |
76 | 109 |
|
77 | | - $services->alias('ApiPlatform\Serializer\Filter\PropertyFilter', 'api_platform.serializer.property_filter'); |
| 110 | + $services->alias(PropertyFilter::class, 'api_platform.serializer.property_filter'); |
78 | 111 |
|
79 | | - $services->set('api_platform.serializer.group_filter', 'ApiPlatform\Serializer\Filter\GroupFilter') |
| 112 | + $services->set('api_platform.serializer.group_filter', GroupFilter::class) |
80 | 113 | ->abstract(); |
81 | 114 |
|
82 | | - $services->alias('ApiPlatform\Serializer\Filter\GroupFilter', 'api_platform.serializer.group_filter'); |
| 115 | + $services->alias(GroupFilter::class, 'api_platform.serializer.group_filter'); |
83 | 116 |
|
84 | | - $services->set('api_platform.serializer.normalizer.item', 'ApiPlatform\Serializer\ItemNormalizer') |
| 117 | + $services->set('api_platform.serializer.normalizer.item', ItemNormalizer::class) |
85 | 118 | ->args([ |
86 | 119 | service('api_platform.metadata.property.name_collection_factory'), |
87 | 120 | service('api_platform.metadata.property.metadata_factory'), |
|
98 | 131 | ]) |
99 | 132 | ->tag('serializer.normalizer', ['priority' => -895]); |
100 | 133 |
|
101 | | - $services->set('api_platform.serializer.mapping.class_metadata_factory', 'ApiPlatform\Serializer\Mapping\Factory\ClassMetadataFactory') |
| 134 | + $services->set('api_platform.serializer.mapping.class_metadata_factory', ClassMetadataFactory::class) |
102 | 135 | ->decorate('serializer.mapping.class_metadata_factory', null, -1) |
103 | 136 | ->args([service('api_platform.serializer.mapping.class_metadata_factory.inner')]); |
104 | 137 |
|
105 | | - $services->set('api_platform.serializer.mapping.cache_class_metadata_factory', 'Symfony\Component\Serializer\Mapping\Factory\CacheClassMetadataFactory') |
| 138 | + $services->set('api_platform.serializer.mapping.cache_class_metadata_factory', CacheClassMetadataFactory::class) |
106 | 139 | ->decorate('api_platform.serializer.mapping.class_metadata_factory', null, -2) |
107 | 140 | ->args([ |
108 | 141 | service('api_platform.serializer.mapping.cache_class_metadata_factory.inner'), |
109 | 142 | service('serializer.mapping.cache.symfony'), |
110 | 143 | ]); |
111 | 144 |
|
112 | | - $services->set('api_platform.path_segment_name_generator.underscore', 'ApiPlatform\Metadata\Operation\UnderscorePathSegmentNameGenerator'); |
| 145 | + $services->set('api_platform.path_segment_name_generator.underscore', UnderscorePathSegmentNameGenerator::class); |
113 | 146 |
|
114 | | - $services->set('api_platform.path_segment_name_generator.dash', 'ApiPlatform\Metadata\Operation\DashPathSegmentNameGenerator'); |
| 147 | + $services->set('api_platform.path_segment_name_generator.dash', DashPathSegmentNameGenerator::class); |
115 | 148 |
|
116 | | - $services->set('api_platform.metadata.path_segment_name_generator.underscore', 'ApiPlatform\Metadata\Operation\UnderscorePathSegmentNameGenerator') |
| 149 | + $services->set('api_platform.metadata.path_segment_name_generator.underscore', UnderscorePathSegmentNameGenerator::class) |
117 | 150 | ->args([service('api_platform.inflector')->nullOnInvalid()]); |
118 | 151 |
|
119 | | - $services->set('api_platform.metadata.path_segment_name_generator.dash', 'ApiPlatform\Metadata\Operation\DashPathSegmentNameGenerator') |
| 152 | + $services->set('api_platform.metadata.path_segment_name_generator.dash', DashPathSegmentNameGenerator::class) |
120 | 153 | ->args([service('api_platform.inflector')->nullOnInvalid()]); |
121 | 154 |
|
122 | | - $services->set('api_platform.metadata.inflector', 'ApiPlatform\Metadata\Util\Inflector'); |
| 155 | + $services->set('api_platform.metadata.inflector', Inflector::class); |
123 | 156 |
|
124 | 157 | $services->set('api_platform.cache.route_name_resolver') |
125 | 158 | ->parent('cache.system') |
126 | 159 | ->tag('cache.pool'); |
127 | 160 |
|
128 | | - $services->set('api_platform.route_loader', 'ApiPlatform\Symfony\Routing\ApiLoader') |
| 161 | + $services->set('api_platform.route_loader', ApiLoader::class) |
129 | 162 | ->args([ |
130 | 163 | service('kernel'), |
131 | 164 | service('api_platform.metadata.resource.name_collection_factory'), |
|
140 | 173 | ]) |
141 | 174 | ->tag('routing.loader'); |
142 | 175 |
|
143 | | - $services->set('api_platform.symfony.iri_converter.skolem', 'ApiPlatform\Symfony\Routing\SkolemIriConverter') |
| 176 | + $services->set('api_platform.symfony.iri_converter.skolem', SkolemIriConverter::class) |
144 | 177 | ->args([service('api_platform.router')]); |
145 | 178 |
|
146 | | - $services->set('api_platform.api.identifiers_extractor', 'ApiPlatform\Metadata\IdentifiersExtractor') |
| 179 | + $services->set('api_platform.api.identifiers_extractor', IdentifiersExtractor::class) |
147 | 180 | ->args([ |
148 | 181 | service('api_platform.metadata.resource.metadata_collection_factory'), |
149 | 182 | service('api_platform.resource_class_resolver'), |
|
154 | 187 |
|
155 | 188 | $services->alias('api_platform.identifiers_extractor', 'api_platform.api.identifiers_extractor'); |
156 | 189 |
|
157 | | - $services->alias('ApiPlatform\Metadata\IdentifiersExtractorInterface', 'api_platform.api.identifiers_extractor'); |
| 190 | + $services->alias(IdentifiersExtractorInterface::class, 'api_platform.api.identifiers_extractor'); |
158 | 191 |
|
159 | | - $services->set('api_platform.uri_variables.converter', 'ApiPlatform\Metadata\UriVariablesConverter') |
| 192 | + $services->set('api_platform.uri_variables.converter', UriVariablesConverter::class) |
160 | 193 | ->args([ |
161 | 194 | service('api_platform.metadata.property.metadata_factory'), |
162 | 195 | service('api_platform.metadata.resource.metadata_collection_factory'), |
163 | 196 | tagged_iterator('api_platform.uri_variables.transformer'), |
164 | 197 | ]); |
165 | 198 |
|
166 | | - $services->set('api_platform.uri_variables.transformer.integer', 'ApiPlatform\Metadata\UriVariableTransformer\IntegerUriVariableTransformer') |
| 199 | + $services->set('api_platform.uri_variables.transformer.integer', IntegerUriVariableTransformer::class) |
167 | 200 | ->tag('api_platform.uri_variables.transformer', ['priority' => -100]); |
168 | 201 |
|
169 | | - $services->set('api_platform.uri_variables.transformer.date_time', 'ApiPlatform\Metadata\UriVariableTransformer\DateTimeUriVariableTransformer') |
| 202 | + $services->set('api_platform.uri_variables.transformer.date_time', DateTimeUriVariableTransformer::class) |
170 | 203 | ->tag('api_platform.uri_variables.transformer', ['priority' => -100]); |
171 | 204 |
|
172 | | - $services->set('api_platform.uri_variables.transformer.api_resource', 'ApiPlatform\Metadata\UriVariableTransformer\ApiResourceUriVariableTransformer') |
| 205 | + $services->set('api_platform.uri_variables.transformer.api_resource', ApiResourceUriVariableTransformer::class) |
173 | 206 | ->args([ |
174 | 207 | service('api_platform.api.identifiers_extractor'), |
175 | 208 | service('api_platform.resource_class_resolver'), |
|
178 | 211 |
|
179 | 212 | $services->alias('api_platform.iri_converter', 'api_platform.symfony.iri_converter'); |
180 | 213 |
|
181 | | - $services->set('api_platform.symfony.iri_converter', 'ApiPlatform\Symfony\Routing\IriConverter') |
| 214 | + $services->set('api_platform.symfony.iri_converter', IriConverter::class) |
182 | 215 | ->args([ |
183 | 216 | service('api_platform.state_provider.locator'), |
184 | 217 | service('api_platform.router'), |
|
190 | 223 | service('api_platform.metadata.operation.metadata_factory'), |
191 | 224 | ]); |
192 | 225 |
|
193 | | - $services->alias('ApiPlatform\Metadata\IriConverterInterface', 'api_platform.symfony.iri_converter'); |
| 226 | + $services->alias(IriConverterInterface::class, 'api_platform.symfony.iri_converter'); |
194 | 227 |
|
195 | | - $services->set('api_platform.state.error_provider', 'ApiPlatform\State\ErrorProvider') |
| 228 | + $services->set('api_platform.state.error_provider', ErrorProvider::class) |
196 | 229 | ->arg('$debug', '%kernel.debug%') |
197 | 230 | ->arg('$resourceClassResolver', service('api_platform.resource_class_resolver')) |
198 | 231 | ->arg('$resourceMetadataCollectionFactory', service('api_platform.metadata.resource.metadata_collection_factory')) |
199 | 232 | ->tag('api_platform.state_provider', ['key' => 'api_platform.state.error_provider']); |
200 | 233 |
|
201 | | - $services->set('api_platform.normalizer.constraint_violation_list', 'ApiPlatform\Serializer\ConstraintViolationListNormalizer') |
| 234 | + $services->set('api_platform.normalizer.constraint_violation_list', ConstraintViolationListNormalizer::class) |
202 | 235 | ->args([ |
203 | 236 | '%api_platform.validator.serialize_payload_fields%', |
204 | 237 | service('api_platform.name_converter')->ignoreOnInvalid(), |
205 | 238 | ]) |
206 | 239 | ->tag('serializer.normalizer', ['priority' => -780]); |
207 | 240 |
|
208 | | - $services->set('api_platform.serializer.property_metadata_loader', 'ApiPlatform\Serializer\Mapping\Loader\PropertyMetadataLoader') |
| 241 | + $services->set('api_platform.serializer.property_metadata_loader', PropertyMetadataLoader::class) |
209 | 242 | ->args([service('api_platform.metadata.property.name_collection_factory')]); |
210 | 243 | }; |
0 commit comments