43
43
use Symfony \Component \Cache \Adapter \ChainAdapter ;
44
44
use Symfony \Component \Cache \Adapter \TagAwareAdapter ;
45
45
use Symfony \Component \Cache \DependencyInjection \CachePoolPass ;
46
- use Symfony \Component \Cache \Marshaller \MarshallerInterface ;
47
- use Symfony \Component \Cache \ResettableInterface ;
48
46
use Symfony \Component \Clock \ClockInterface ;
49
47
use Symfony \Component \Config \Definition \ConfigurationInterface ;
50
48
use Symfony \Component \Config \FileLocator ;
55
53
use Symfony \Component \Console \Application ;
56
54
use Symfony \Component \Console \Attribute \AsCommand ;
57
55
use Symfony \Component \Console \Command \Command ;
58
- use Symfony \Component \Console \DataCollector \CommandDataCollector ;
59
- use Symfony \Component \Console \Debug \CliRequest ;
60
56
use Symfony \Component \Console \Messenger \RunCommandMessageHandler ;
61
57
use Symfony \Component \DependencyInjection \Alias ;
62
58
use Symfony \Component \DependencyInjection \Argument \IteratorArgument ;
82
78
use Symfony \Component \Filesystem \Filesystem ;
83
79
use Symfony \Component \Finder \Finder ;
84
80
use Symfony \Component \Finder \Glob ;
85
- use Symfony \Component \Form \EnumFormTypeGuesser ;
86
81
use Symfony \Component \Form \Form ;
87
82
use Symfony \Component \Form \FormTypeExtensionInterface ;
88
83
use Symfony \Component \Form \FormTypeGuesserInterface ;
105
100
use Symfony \Component \HttpKernel \DataCollector \DataCollectorInterface ;
106
101
use Symfony \Component \HttpKernel \DependencyInjection \Extension ;
107
102
use Symfony \Component \HttpKernel \Log \DebugLoggerConfigurator ;
108
- use Symfony \Component \HttpKernel \Profiler \ProfilerStateChecker ;
109
103
use Symfony \Component \JsonStreamer \Attribute \JsonStreamable ;
110
104
use Symfony \Component \JsonStreamer \JsonStreamWriter ;
111
105
use Symfony \Component \JsonStreamer \StreamReaderInterface ;
122
116
use Symfony \Component \Messenger \Attribute \AsMessage ;
123
117
use Symfony \Component \Messenger \Attribute \AsMessageHandler ;
124
118
use Symfony \Component \Messenger \Bridge as MessengerBridge ;
125
- use Symfony \Component \Messenger \EventListener \ResetMemoryUsageListener ;
126
119
use Symfony \Component \Messenger \Handler \BatchHandlerInterface ;
127
120
use Symfony \Component \Messenger \MessageBus ;
128
121
use Symfony \Component \Messenger \MessageBusInterface ;
129
- use Symfony \Component \Messenger \Middleware \DeduplicateMiddleware ;
130
122
use Symfony \Component \Messenger \Middleware \RouterContextMiddleware ;
131
123
use Symfony \Component \Messenger \Transport \Serialization \SerializerInterface ;
132
124
use Symfony \Component \Messenger \Transport \TransportFactoryInterface as MessengerTransportFactoryInterface ;
163
155
use Symfony \Component \RemoteEvent \Attribute \AsRemoteEventConsumer ;
164
156
use Symfony \Component \RemoteEvent \RemoteEvent ;
165
157
use Symfony \Component \Routing \Attribute \Route ;
166
- use Symfony \Component \Routing \Loader \AttributeServicesLoader ;
167
158
use Symfony \Component \Scheduler \Attribute \AsCronTask ;
168
159
use Symfony \Component \Scheduler \Attribute \AsPeriodicTask ;
169
160
use Symfony \Component \Scheduler \Attribute \AsSchedule ;
170
161
use Symfony \Component \Scheduler \Messenger \SchedulerTransportFactory ;
171
- use Symfony \Component \Scheduler \Messenger \Serializer \Normalizer \SchedulerTriggerNormalizer ;
172
162
use Symfony \Component \Security \Core \AuthenticationEvents ;
173
163
use Symfony \Component \Security \Core \Exception \AuthenticationException ;
174
164
use Symfony \Component \Security \Csrf \CsrfToken ;
178
168
use Symfony \Component \Semaphore \SemaphoreFactory ;
179
169
use Symfony \Component \Semaphore \Store \StoreFactory as SemaphoreStoreFactory ;
180
170
use Symfony \Component \Serializer \Attribute as SerializerMapping ;
181
- use Symfony \Component \Serializer \DependencyInjection \AttributeMetadataPass as SerializerAttributeMetadataPass ;
182
171
use Symfony \Component \Serializer \Encoder \DecoderInterface ;
183
172
use Symfony \Component \Serializer \Encoder \EncoderInterface ;
184
173
use Symfony \Component \Serializer \Mapping \Loader \XmlFileLoader ;
204
193
use Symfony \Component \Uid \UuidV4 ;
205
194
use Symfony \Component \Validator \Constraint ;
206
195
use Symfony \Component \Validator \Constraints \ExpressionLanguageProvider ;
207
- use Symfony \Component \Validator \Constraints \Traverse ;
208
196
use Symfony \Component \Validator \ConstraintValidatorInterface ;
209
- use Symfony \Component \Validator \DependencyInjection \AttributeMetadataPass as ValidatorAttributeMetadataPass ;
210
197
use Symfony \Component \Validator \GroupProviderInterface ;
211
198
use Symfony \Component \Validator \Mapping \Loader \PropertyInfoLoader ;
212
199
use Symfony \Component \Validator \ObjectInitializerInterface ;
@@ -675,12 +662,6 @@ public function load(array $configs, ContainerBuilder $container): void
675
662
->addTag ('kernel.locale_aware ' );
676
663
$ container ->registerForAutoconfiguration (ResetInterface::class)
677
664
->addTag ('kernel.reset ' , ['method ' => 'reset ' ]);
678
-
679
- if (!interface_exists (MarshallerInterface::class)) {
680
- $ container ->registerForAutoconfiguration (ResettableInterface::class)
681
- ->addTag ('kernel.reset ' , ['method ' => 'reset ' ]);
682
- }
683
-
684
665
$ container ->registerForAutoconfiguration (PropertyListExtractorInterface::class)
685
666
->addTag ('property_info.list_extractor ' );
686
667
$ container ->registerForAutoconfiguration (PropertyTypeExtractorInterface::class)
@@ -842,10 +823,6 @@ private function registerFormConfiguration(array $config, ContainerBuilder $cont
842
823
{
843
824
$ loader ->load ('form.php ' );
844
825
845
- if (!class_exists (EnumFormTypeGuesser::class)) {
846
- $ container ->removeDefinition ('form.type_guesser.enum_type ' );
847
- }
848
-
849
826
if (null === $ config ['form ' ]['csrf_protection ' ]['enabled ' ]) {
850
827
$ this ->writeConfigEnabled ('form.csrf_protection ' , $ config ['csrf_protection ' ]['enabled ' ], $ config ['form ' ]['csrf_protection ' ]);
851
828
}
@@ -944,11 +921,6 @@ private function registerProfilerConfiguration(array $config, ContainerBuilder $
944
921
$ loader ->load ('collectors.php ' );
945
922
$ loader ->load ('cache_debug.php ' );
946
923
947
- if (!class_exists (ProfilerStateChecker::class)) {
948
- $ container ->removeDefinition ('profiler.state_checker ' );
949
- $ container ->removeDefinition ('profiler.is_disabled_state_checker ' );
950
- }
951
-
952
924
if ($ this ->isInitializedConfigEnabled ('form ' )) {
953
925
$ loader ->load ('form_debug.php ' );
954
926
}
@@ -1005,13 +977,9 @@ private function registerProfilerConfiguration(array $config, ContainerBuilder $
1005
977
$ container ->getDefinition ('profiler_listener ' )
1006
978
->addArgument ($ config ['collect_parameter ' ]);
1007
979
1008
- if (!$ container ->getParameter ('kernel.debug ' ) || !class_exists (CliRequest::class) || ! $ container ->has ('debug.stopwatch ' )) {
980
+ if (!$ container ->getParameter ('kernel.debug ' ) || !$ container ->has ('debug.stopwatch ' )) {
1009
981
$ container ->removeDefinition ('console_profiler_listener ' );
1010
982
}
1011
-
1012
- if (!class_exists (CommandDataCollector::class)) {
1013
- $ container ->removeDefinition ('.data_collector.command ' );
1014
- }
1015
983
}
1016
984
1017
985
private function registerWorkflowConfiguration (array $ config , ContainerBuilder $ container , PhpFileLoader $ loader ): void
@@ -1269,10 +1237,6 @@ private function registerRouterConfiguration(array $config, ContainerBuilder $co
1269
1237
1270
1238
$ loader ->load ('routing.php ' );
1271
1239
1272
- if (!class_exists (AttributeServicesLoader::class)) {
1273
- $ container ->removeDefinition ('routing.loader.attribute.services ' );
1274
- }
1275
-
1276
1240
if ($ config ['utf8 ' ]) {
1277
1241
$ container ->getDefinition ('routing.loader ' )->replaceArgument (1 , ['utf8 ' => true ]);
1278
1242
}
@@ -1765,7 +1729,7 @@ private function registerValidationConfiguration(array $config, ContainerBuilder
1765
1729
1766
1730
// When attributes are disabled, it means from runtime-discovery only; autoconfiguration should still happen.
1767
1731
// And when runtime-discovery of attributes is enabled, we can skip compile-time autoconfiguration in debug mode.
1768
- if (class_exists (ValidatorAttributeMetadataPass::class) && ( !($ config ['enable_attributes ' ] ?? false ) || !$ container ->getParameter ('kernel.debug ' ) )) {
1732
+ if (!($ config ['enable_attributes ' ] ?? false ) || !$ container ->getParameter ('kernel.debug ' )) {
1769
1733
// The $reflector argument hints at where the attribute could be used
1770
1734
$ container ->registerAttributeForAutoconfiguration (Constraint::class, function (ChildDefinition $ definition , Constraint $ attribute , \ReflectionClass |\ReflectionMethod |\ReflectionProperty $ reflector ) {
1771
1735
$ definition ->addTag ('validator.attribute_metadata ' );
@@ -1817,9 +1781,6 @@ private function registerValidatorMapping(ContainerBuilder $container, array $co
1817
1781
1818
1782
if (!ContainerBuilder::willBeAvailable ('symfony/form ' , Form::class, ['symfony/framework-bundle ' , 'symfony/validator ' ])) {
1819
1783
$ container ->removeDefinition ('validator.form.attribute_metadata ' );
1820
- } elseif (!($ r = new \ReflectionClass (Form::class))->getAttributes (Traverse::class) || !class_exists (ValidatorAttributeMetadataPass::class)) {
1821
- // BC with symfony/form & symfony/validator < 7.4
1822
- $ fileRecorder ('xml ' , \dirname ($ r ->getFileName ()).'/Resources/config/validation.xml ' );
1823
1784
}
1824
1785
1825
1786
foreach ($ container ->getParameter ('kernel.bundles_metadata ' ) as $ bundle ) {
@@ -2015,7 +1976,7 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
2015
1976
2016
1977
// When attributes are disabled, it means from runtime-discovery only; autoconfiguration should still happen.
2017
1978
// And when runtime-discovery of attributes is enabled, we can skip compile-time autoconfiguration in debug mode.
2018
- if (class_exists (SerializerAttributeMetadataPass::class) && ( !($ config ['enable_attributes ' ] ?? false ) || !$ container ->getParameter ('kernel.debug ' ) )) {
1979
+ if (!($ config ['enable_attributes ' ] ?? false ) || !$ container ->getParameter ('kernel.debug ' )) {
2019
1980
// The $reflector argument hints at where the attribute could be used
2020
1981
$ configurator = function (ChildDefinition $ definition , object $ attribute , \ReflectionClass |\ReflectionMethod |\ReflectionProperty $ reflector ) {
2021
1982
$ definition ->addTag ('serializer.attribute_metadata ' );
@@ -2036,15 +1997,10 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
2036
1997
});
2037
1998
}
2038
1999
2039
- if (($ config ['enable_attributes ' ] ?? false ) || class_exists (SerializerAttributeMetadataPass::class)) {
2040
- $ serializerLoaders [] = new Reference ('serializer.mapping.attribute_loader ' );
2000
+ $ serializerLoaders [] = new Reference ('serializer.mapping.attribute_loader ' );
2041
2001
2042
- $ container ->getDefinition ('serializer.mapping.attribute_loader ' )
2043
- ->replaceArgument (0 , $ config ['enable_attributes ' ] ?? false );
2044
- } else {
2045
- // BC with symfony/serializer < 7.4
2046
- $ container ->removeDefinition ('serializer.mapping.attribute_services_loader ' );
2047
- }
2002
+ $ container ->getDefinition ('serializer.mapping.attribute_loader ' )
2003
+ ->replaceArgument (0 , $ config ['enable_attributes ' ] ?? false );
2048
2004
2049
2005
$ fileRecorder = function ($ extension , $ path ) use (&$ serializerLoaders ) {
2050
2006
$ definition = new Definition (\in_array ($ extension , ['yaml ' , 'yml ' ], true ) ? YamlFileLoader::class : XmlFileLoader::class, [$ path ]);
@@ -2288,11 +2244,6 @@ private function registerSchedulerConfiguration(ContainerBuilder $container, Php
2288
2244
if (!$ this ->hasConsole ()) {
2289
2245
$ container ->removeDefinition ('console.command.scheduler_debug ' );
2290
2246
}
2291
-
2292
- // BC layer Scheduler < 7.3
2293
- if (!ContainerBuilder::willBeAvailable ('symfony/serializer ' , DenormalizerInterface::class, ['symfony/framework-bundle ' , 'symfony/scheduler ' ]) || !class_exists (SchedulerTriggerNormalizer::class)) {
2294
- $ container ->removeDefinition ('serializer.normalizer.scheduler_trigger ' );
2295
- }
2296
2247
}
2297
2248
2298
2249
private function registerMessengerConfiguration (array $ config , ContainerBuilder $ container , PhpFileLoader $ loader , bool $ validationEnabled , bool $ lockEnabled ): void
@@ -2311,10 +2262,6 @@ private function registerMessengerConfiguration(array $config, ContainerBuilder
2311
2262
$ container ->removeDefinition ('serializer.normalizer.flatten_exception ' );
2312
2263
}
2313
2264
2314
- if (!class_exists (ResetMemoryUsageListener::class)) {
2315
- $ container ->removeDefinition ('messenger.listener.reset_memory_usage ' );
2316
- }
2317
-
2318
2265
if (ContainerBuilder::willBeAvailable ('symfony/amqp-messenger ' , MessengerBridge \Amqp \Transport \AmqpTransportFactory::class, ['symfony/framework-bundle ' , 'symfony/messenger ' ])) {
2319
2266
$ container ->getDefinition ('messenger.transport.amqp.factory ' )->addTag ('messenger.transport_factory ' );
2320
2267
}
@@ -2355,7 +2302,7 @@ private function registerMessengerConfiguration(array $config, ContainerBuilder
2355
2302
],
2356
2303
];
2357
2304
2358
- if ($ lockEnabled && class_exists (DeduplicateMiddleware::class) && class_exists ( LockFactory::class)) {
2305
+ if ($ lockEnabled && class_exists (LockFactory::class)) {
2359
2306
$ defaultMiddleware ['before ' ][] = ['id ' => 'deduplicate_middleware ' ];
2360
2307
} else {
2361
2308
$ container ->removeDefinition ('messenger.middleware.deduplicate_middleware ' );
0 commit comments