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