DoctrineDbalAdapternow takes an optional$isSameDatabaseparameter
- Return int or false from
SignalableCommandInterface::handleSignal()instead of void and add a second argument$previousExitCode
- Deprecate
PhpDumperoptionsinline_factories_parameterandinline_class_loader_parameter, useinline_factoriesandinline_class_loaderinstead - Deprecate undefined and numeric keys with
service_locatorconfig, use string aliases instead - Deprecate
#[MapDecorated], use#[AutowireDecorated]instead - Deprecate the
@requiredannotation, use theSymfony\Contracts\Service\Attribute\Requiredattribute instead
-
Deprecate passing Doctrine subscribers to
ContainerAwareEventManagerclass, use listeners insteadBefore
use Doctrine\Bundle\DoctrineBundle\EventSubscriber\EventSubscriberInterface; use Doctrine\ORM\Event\PostFlushEventArgs; use Doctrine\ORM\Events; class InvalidateCacheSubscriber implements EventSubscriberInterface { public function getSubscribedEvents(): array { return [Events::postFlush]; } public function postFlush(PostFlushEventArgs $args): void { // ... } }
After
use Doctrine\Bundle\DoctrineBundle\Attribute\AsDoctrineListener; use Doctrine\ORM\Event\PostFlushEventArgs; use Doctrine\ORM\Events; // Instead of PHP attributes, you can also tag this service with "doctrine.event_listener" #[AsDoctrineListener(event: Events::postFlush)] class InvalidateCacheSubscriber { public function postFlush(PostFlushEventArgs $args): void { // ... } }
-
Deprecate
DoctrineDbalCacheAdapterSchemaSubscriberin favor ofDoctrineDbalCacheAdapterSchemaListener -
Deprecate
MessengerTransportDoctrineSchemaSubscriberin favor ofMessengerTransportDoctrineSchemaListener -
Deprecate
RememberMeTokenProviderDoctrineSchemaSubscriberin favor ofRememberMeTokenProviderDoctrineSchemaListener -
DoctrineTransportnow takes an optional$isSameDatabaseparameter -
DoctrineTokenProvidernow takes an optional$isSameDatabaseparameter
- Deprecate not configuring the "widget" option of date/time form types, it will default to "single_text" in v7
-
Deprecate
framework:exceptionstag, unwrap it and replaceframework:exceptiontags'nameattribute byclassBefore:
<!-- config/packages/framework.xml --> <framework:config> <framework:exceptions> <framework:exception name="Symfony\Component\HttpKernel\Exception\BadRequestHttpException" log-level="info" status-code="422" /> </framework:exceptions> </framework:config>
After:
<!-- config/packages/framework.xml --> <framework:config> <framework:exception class="Symfony\Component\HttpKernel\Exception\BadRequestHttpException" log-level="info" status-code="422" /> </framework:config>
-
Deprecate the
notifier.logger_notification_listenerservice, use thenotifier.notification_logger_listenerservice instead -
Deprecate the
Http\Client\HttpClientservice, usePsr\Http\Client\ClientInterfaceinstead
- The minimum TLS version now defaults to v1.2; use the
crypto_methodoption if you need to connect to servers that don't support it - The default user agents have been renamed from
Symfony HttpClient/Amp,Symfony HttpClient/CurlandSymfony HttpClient/NativetoSymfony HttpClient (Amp),Symfony HttpClient (Curl)andSymfony HttpClient (Native)respectively to comply with the RFC 9110 specification
Response::sendHeaders()now takes an optional$statusCodeparameter- Deprecate conversion of invalid values in
ParameterBag::getInt()andParameterBag::getBoolean() - Deprecate ignoring invalid values when using
ParameterBag::filter(), unless flagFILTER_NULL_ON_FAILUREis set
- Deprecate parameters
container.dumper.inline_factoriesandcontainer.dumper.inline_class_loader, use.container.dumper.inline_factoriesand.container.dumper.inline_class_loaderinstead
- Deprecate the
gcProbablityoption to fix a typo in its name, use thegcProbabilityoption instead - Add optional parameter
$isSameDatabasetoDoctrineDbalStore::configureSchema()
- Deprecate
Symfony\Component\Messenger\Transport\InMemoryTransportandSymfony\Component\Messenger\Transport\InMemoryTransportFactoryin favor ofSymfony\Component\Messenger\Transport\InMemory\InMemoryTransportandSymfony\Component\Messenger\Transport\InMemory\InMemoryTransportFactory - Deprecate
StopWorkerOnSigtermSignalListenerin favor ofStopWorkerOnSignalsListener
- [BC BREAK] The following data providers for
TransportTestCaseare now static:toStringProvider(),supportedMessagesProvider()andunsupportedMessagesProvider() - [BC BREAK] The
TransportTestCase::createTransport()method is now static
- Deprecate passing a secret as the 2nd argument to the constructor of
Symfony\Component\Security\Http\RememberMe\PersistentRememberMeHandler
- Deprecate enabling bundle and not configuring it, either remove the bundle or configure at least one firewall
- Deprecate the
security.firewalls.logout.csrf_token_generatorconfig option, usesecurity.firewalls.logout.csrf_token_managerinstead
-
Deprecate
CacheableSupportsMethodInterfacein favor of the newgetSupportedTypes(?string $format)methodsBefore
use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface; class TopicNormalizer implements NormalizerInterface, CacheableSupportsMethodInterface { public function supportsNormalization($data, string $format = null, array $context = []): bool { return $data instanceof Topic; } public function hasCacheableSupportsMethod(): bool { return true; } // ... }
After
use Symfony\Component\Serializer\Normalizer\NormalizerInterface; class TopicNormalizer implements NormalizerInterface { public function supportsNormalization($data, string $format = null, array $context = []): bool { return $data instanceof Topic; } public function getSupportedTypes(?string $format): array { return [ Topic::class => true, ]; } // ... }
-
The following Normalizer classes will become final in 7.0, use decoration instead of inheritance:
ConstraintViolationListNormalizerCustomNormalizerDataUriNormalizerDateIntervalNormalizerDateTimeNormalizerDateTimeZoneNormalizerGetSetMethodNormalizerJsonSerializableNormalizerObjectNormalizerPropertyNormalizer
Before
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer; class TopicNormalizer extends ObjectNormalizer { // ... public function normalize($topic, string $format = null, array $context = []): array { $data = parent::normalize($topic, $format, $context); // ... } }
After
use Symfony\Component\DependencyInjection\Attribute\Autowire; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; class TopicNormalizer implements NormalizerInterface { public function __construct( #[Autowire(service: 'serializer.normalizer.object')] private NormalizerInterface&DenormalizerInterface $objectNormalizer, ) { } public function normalize($topic, string $format = null, array $context = []): array { $data = $this->objectNormalizer->normalize($topic, $format, $context); // ... } // ... }
- Implementing the
ConstraintViolationInterfacewithout implementing thegetConstraint()method is deprecated