- Removed
RemoteJsonManifestVersionStrategy, useJsonManifestVersionStrategyinstead.
- Remove
UserLoaderInterface::loadUserByUsername()in favor ofUserLoaderInterface::loadUserByIdentifier()
- Remove
DoctrineProviderbecause it has been added to thedoctrine/cachepackage
- The signature of method
NodeDefinition::setDeprecated()has been updated toNodeDefinition::setDeprecation(string $package, string $version, string $message). - The signature of method
BaseNode::setDeprecated()has been updated toBaseNode::setDeprecation(string $package, string $version, string $message). - Passing a null message to
BaseNode::setDeprecated()to un-deprecate a node is not supported anymore. - Removed
BaseNode::getDeprecationMessage(), useBaseNode::getDeprecation()instead.
Command::setHidden()has a default value (true) for$hiddenparameter- Remove
Helper::strlen(), useHelper::width()instead. - Remove
Helper::strlenWithoutDecoration(), useHelper::removeDecoration()instead.
- The signature of method
Definition::setDeprecated()has been updated toDefinition::setDeprecation(string $package, string $version, string $message). - The signature of method
Alias::setDeprecated()has been updated toAlias::setDeprecation(string $package, string $version, string $message). - The signature of method
DeprecateTrait::deprecate()has been updated toDeprecateTrait::deprecation(string $package, string $version, string $message). - Removed the
Psr\Container\ContainerInterfaceandSymfony\Component\DependencyInjection\ContainerInterfacealiases of theservice_containerservice, configure them explicitly instead. - Removed
Definition::getDeprecationMessage(), useDefinition::getDeprecation()instead. - Removed
Alias::getDeprecationMessage(), useAlias::getDeprecation()instead. - The
inline()function from the PHP-DSL has been removed, useinline_service()instead. - The
ref()function from the PHP-DSL has been removed, useservice()instead. - Removed
Definition::setPrivate()andAlias::setPrivate(), usesetPublic()instead
- Removed the
parents()method, useancestors()instead.
- Removed argument
$usePutenvfrom Dotenv's constructor, useDotenv::usePutenv()instead.
- Removed
LegacyEventDispatcherProxy. Use the event dispatcher without the proxy.
- Remove
Comparator::setTarget()andComparator::setOperator() - The
$targetparameter ofComparator::__construct()is now mandatory
- The default value of the
rounding_modeoption of thePercentTypehas been changed to\NumberFormatter::ROUND_HALFUP. - The default rounding mode of the
PercentToLocalizedStringTransformerhas been changed to\NumberFormatter::ROUND_HALFUP. - Added the
getIsEmptyCallback()method to theFormConfigInterface. - Added the
setIsEmptyCallback()method to theFormConfigBuilderInterface. - Added argument
callable|null $filtertoChoiceListFactoryInterface::createListFromChoices()andcreateListFromLoader(). - The
Symfony\Component\Form\Extension\Validator\Util\ServerParamsclass has been removed, use its parentSymfony\Component\Form\Util\ServerParamsinstead. - The
NumberToLocalizedStringTransformer::ROUND_*constants have been removed, use\NumberFormatter::ROUND_*instead. - Removed
PropertyPathMapperin favor ofDataMapperandPropertyPathAccessor. - Changed
$formsparameter type of theDataMapper::mapDataToForms()method fromiterableto\Traversable. - Changed
$formsparameter type of theDataMapper::mapFormsToData()method fromiterableto\Traversable. - Changed
$checkboxesparameter type of theCheckboxListMapper::mapDataToForms()method fromiterableto\Traversable. - Changed
$checkboxesparameter type of theCheckboxListMapper::mapFormsToData()method fromiterableto\Traversable. - Changed
$radiosparameter type of theRadioListMapper::mapDataToForms()method fromiterableto\Traversable. - Changed
$radiosparameter type of theRadioListMapper::mapFormsToData()method fromiterableto\Traversable.
- Remove the
session.storagealias andsession.storage.*services, use thesession.storage.factoryalias andsession.storage.factory.*services instead - Remove
framework.session.storage_idconfiguration option, use theframework.session.storage_factory_idconfiguration option instead - Remove the
sessionservice and theSessionInterfacealias, use the\Symfony\Component\HttpFoundation\Request::getSession()or the new\Symfony\Component\HttpFoundation\RequestStack::getSession()methods instead MicroKernelTrait::configureRoutes()is now always called with aRoutingConfigurator- The "framework.router.utf8" configuration option defaults to
true - Removed
session.attribute_bagservice andsession.flash_bagservice. - The
form.factory,form.type.file,profiler,translator,security.csrf.token_manager,serializer,cache_clearer,filesystemandvalidatorservices are now private. - Removed the
lock.RESOURCE_NAMEandlock.RESOURCE_NAME.storeservices and thelock,LockInterface,lock.storeandPersistingStoreInterfacealiases, uselock.RESOURCE_NAME.factory,lock.factoryorLockFactoryinstead. - Remove the
KernelTestCase::$containerproperty, useKernelTestCase::getContainer()instead - Registered workflow services are now private
- Remove option
--xliff-versionof thetranslation:updatecommand, use e.g.--output-format=xlf20instead - Remove option
--output-formatof thetranslation:updatecommand, use e.g.--output-format=xlf20instead - Remove the
AdapterInterfaceautowiring alias, useCacheItemPoolInterfaceinstead
- Remove the
NamespacedAttributeBagclass - Removed
Response::create(),JsonResponse::create(),RedirectResponse::create(),StreamedResponse::create()andBinaryFileResponse::create()methods (use__construct()instead) - Not passing a
Closuretogether withFILTER_CALLBACKtoParameterBag::filter()throws anInvalidArgumentException; wrap your filter in a closure instead. - Removed the
Request::HEADER_X_FORWARDED_ALLconstant, use eitherRequest::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTOorRequest::HEADER_X_FORWARDED_AWS_ELBorRequest::HEADER_X_FORWARDED_TRAEFIKconstants instead. - Rename
RequestStack::getMasterRequest()togetMainRequest()
- Remove
ArgumentInterface - Remove
ArgumentMetadata::getAttribute(), usegetAttributes()instead - Make
WarmableInterface::warmUp()return a list of classes or files to preload on PHP 7.4+ - Remove support for
service:actionsyntax to reference controllers. UseserviceOrFqcn::methodinstead. - Remove support for returning a
ContainerBuilderfromKernelInterface::registerContainerConfiguration() - Rename
HttpKernelInterface::MASTER_REQUESTtoMAIN_REQUEST - Rename
KernelEvent::isMasterRequest()toisMainRequest()
- The component has been removed, use
EnglishInflectorfrom the String component instead.
- Removed the
NotSupportedException. It shouldn't be thrown anymore. - Removed the
RetryTillSaveStore. Logic has been moved inLockand is not needed anymore.
- Removed the
SesApiTransportclass. UseSesApiAsyncAwsTransportinstead. - Removed the
SesHttpTransportclass. UseSesHttpAsyncAwsTransportinstead.
- Removed AmqpExt transport. Run
composer require symfony/amqp-messengerto keep the transport in your application. - Removed Doctrine transport. Run
composer require symfony/doctrine-messengerto keep the transport in your application. - Removed RedisExt transport. Run
composer require symfony/redis-messengerto keep the transport in your application. - Use of invalid options in Redis and AMQP connections now throws an error.
- The signature of method
RetryStrategyInterface::isRetryable()has been updated toRetryStrategyInterface::isRetryable(Envelope $message, \Throwable $throwable = null). - The signature of method
RetryStrategyInterface::getWaitingTime()has been updated toRetryStrategyInterface::getWaitingTime(Envelope $message, \Throwable $throwable = null). - Removed the
prefetch_countparameter in the AMQP bridge. - Removed the use of TLS option for Redis Bridge, use
rediss://127.0.0.1instead ofredis://127.0.0.1?tls=1 - The
delete_after_ackconfig option of the Redis transport now defaults totrue
- Removed
Address::fromString(), useAddress::create()instead
- The
$actionLevelconstructor argument ofSymfony\Bridge\Monolog\Handler\FingersCrossed\NotFoundActivationStrategyhas been replaced by the$innerone which expects an ActivationStrategyInterface to decorate instead.Symfony\Bridge\Monolog\Handler\FingersCrossed\NotFoundActivationStrategyis now final. - The
$actionLevelconstructor argument ofSymfony\Bridge\Monolog\Handler\FingersCrossed\HttpCodeActivationStrategyhas been replaced by the$innerone which expects an ActivationStrategyInterface to decorate instead.Symfony\Bridge\Monolog\Handler\FingersCrossed\HttpCodeActivationStrategyis now final.
- Remove
SlackOptions::channel(), useSlackOptions::recipient()instead.
- The signature of method
OptionsResolver::setDeprecated()has been updated toOptionsResolver::setDeprecated(string $option, string $package, string $version, $message). - Removed
OptionsResolverIntrospector::getDeprecationMessage(), useOptionsResolverIntrospector::getDeprecation()instead.
- Removed support for
@expectedDeprecationannotations, use theExpectDeprecationTrait::expectDeprecation()method instead. - Removed the
SetUpTearDownTraittrait, use original methods with "void" return typehint.
- Drop support for booleans as the second argument of
PropertyAccessor::__construct(), pass a combination of bitwise flags instead. - Dropped support for booleans as the first argument of
PropertyAccessor::__construct(). Pass a combination of bitwise flags instead.
- Removed the
Type::getCollectionKeyType()andType::getCollectionValueType()methods, useType::getCollectionKeyTypes()andType::getCollectionValueTypes()instead. - Dropped the
enable_magic_call_extractioncontext option inReflectionExtractor::getWriteInfo()andReflectionExtractor::getReadInfo()in favor ofenable_magic_methods_extraction.
- Removed
RouteCollectionBuilder. - Added argument
$prioritytoRouteCollection::add() - Removed the
RouteCompiler::REGEX_DELIMITERconstant - Removed the
$dataparameter from the constructor of theRouteannotation class
-
Remove the 4th and 5th argument of
AuthorizationChecker -
Remove the 5th argument of
AccessListener -
Remove class
User, useInMemoryUseror your own implementation instead. If you are using theisAccountNonLocked(),isAccountNonExpired()orisCredentialsNonExpired()method, consider re-implementing them in your own user class as they are not part of theInMemoryUserAPI -
Remove class
UserChecker, useInMemoryUserCheckeror your own implementation instead -
Remove
UserInterface::getPassword()If yourgetPassword()method does not returnnull(i.e. you are using password-based authentication), you should implementPasswordAuthenticatedUserInterface.Before:
use Symfony\Component\Security\Core\User\UserInterface; class User implements UserInterface { // ... public function getPassword() { return $this->password; } }
After:
use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface; class User implements UserInterface, PasswordAuthenticatedUserInterface { // ... public function getPassword(): ?string { return $this->password; } }
-
Remove
UserInterface::getSalt()If yourgetSalt()method does not returnnull(i.e. you are using password-based authentication with an old password hash algorithm that requires user-provided salts), implementLegacyPasswordAuthenticatedUserInterface.Before:
use Symfony\Component\Security\Core\User\UserInterface; class User implements UserInterface { // ... public function getPassword() { return $this->password; } public function getSalt() { return $this->salt; } }
After:
use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Core\User\LegacyPasswordAuthenticatedUserInterface; class User implements UserInterface, LegacyPasswordAuthenticatedUserInterface { // ... public function getPassword(): ?string { return $this->password; } public function getSalt(): ?string { return $this->salt; } }
-
Remove
UserInterface::getUsername()in favor ofUserInterface::getUserIdentifier() -
Remove
TokenInterface::getUsername()in favor ofTokenInterface::getUserIdentifier() -
Remove
UserProviderInterface::loadUserByUsername()in favor ofUserProviderInterface::loadUserByIdentifier() -
Remove
UsernameNotFoundExceptionin favor ofUserNotFoundExceptionandgetUsername()/setUsername()in favor ofgetUserIdentifier()/setUserIdentifier() -
Remove
PersistentTokenInterface::getUsername()in favor ofPersistentTokenInterface::getUserIdentifier() -
Calling
PasswordUpgraderInterface::upgradePassword()with aUserInterfaceinstance that does not implementPasswordAuthenticatedUserInterfacenow throws a\TypeError. -
Calling methods
hashPassword(),isPasswordValid()andneedsRehash()onUserPasswordHasherInterfacewith aUserInterfaceinstance that does not implementPasswordAuthenticatedUserInterfacenow throws a\TypeError -
Drop all classes in the
Core\Encoder\sub-namespace, use thePasswordHashercomponent instead -
Drop support for
SessionInterface $sessionas constructor argument ofSessionTokenStorage, inject a\Symfony\Component\HttpFoundation\RequestStack $requestStackinstead -
Drop support for
sessionprovided by the ServiceLocator injected inUsageTrackingTokenStorage, provide arequest_stackservice instead -
Make
SessionTokenStoragethrow aSessionNotFoundExceptionwhen called outside a request context -
Removed
ROLE_PREVIOUS_ADMINrole in favor ofIS_IMPERSONATORattribute -
Removed
LogoutSuccessHandlerInterfaceandLogoutHandlerInterface, register a listener on theLogoutEventevent instead. -
Removed
DefaultLogoutSuccessHandlerin favor ofDefaultLogoutListener. -
Added a
logout(Request $request, Response $response, TokenInterface $token)method to theRememberMeServicesInterface. -
Removed
setProviderKey()/getProviderKey()in favor ofsetFirewallName()/getFirewallName()inPreAuthenticatedToken,RememberMeToken,SwitchUserToken,UsernamePasswordToken,DefaultAuthenticationSuccessHandler. -
Removed the
AbstractRememberMeServices::$providerKeyproperty in favor ofAbstractRememberMeServices::$firewallName -
AccessDecisionManagernow throw an exception when a voter does not return a valid decision. -
Remove
AuthenticationManagerInterface,AuthenticationProviderManager,AnonymousAuthenticationProvider,AuthenticationProviderInterface,DaoAuthenticationProvider,LdapBindAuthenticationProvider,PreAuthenticatedAuthenticationProvider,RememberMeAuthenticationProvider,UserAuthenticationProviderandAuthenticationFailureEventfrom security-core, use the new authenticator system instead -
Remove
AbstractAuthenticationListener,AbstractPreAuthenticatedListener,AnonymousAuthenticationListener,BasicAuthenticationListener,RememberMeListener,RemoteUserAuthenticationListener,UsernamePasswordFormAuthenticationListener,UsernamePasswordJsonAuthenticationListenerandX509AuthenticationListenerfrom security-http, use the new authenticator system instead -
Remove the Guard component, use the new authenticator system instead
-
Remove
TokenInterface:isAuthenticated()andsetAuthenticated()methods without replacement. Security tokens won't have an "authenticated" flag anymore, so they will always be considered authenticated -
Remove
DeauthenticatedEvent, useTokenDeauthenticatedEventinstead -
Remove
CookieClearingLogoutHandler,SessionLogoutHandlerandCsrfTokenClearingLogoutHandler. UseCookieClearingLogoutListener,SessionLogoutListenerandCsrfTokenClearingLogoutListenerinstead -
Remove
AuthenticatorInterface::createAuthenticatedToken(), useAuthenticatorInterface::createToken()instead -
Remove
PassportInterfaceandUserPassportInterface, usePassportinstead. Also, the return type declaration ofAuthenticatorInterface::authenticate()was changed toPassportBefore:
class MyAuthenticator implements AuthenticatorInterface { public function authenticate(Request $request): PassportInterface { } }
After:
class MyAuthenticator implements AuthenticatorInterface { public function authenticate(Request $request): Passport { } }
-
Remove
SecurityFactoryInterfaceandSecurityExtension::addSecurityListenerFactory()in favor ofAuthenticatorFactoryInterfaceandSecurityExtension::addAuthenticatorFactory() -
Add
AuthenticatorFactoryInterface::getPriority()which replacesSecurityFactoryInterface::getPosition(). Previous positions are mapped to the following priorities:Position Constant Priority pre_auth RemoteUserFactory::PRIORITY/X509Factory::PRIORITY-10 form FormLoginFactory::PRIORITY-30 http HttpBasicFactory::PRIORITY-50 remember_me RememberMeFactory::PRIORITY-60 anonymous n/a -70 -
Remove passing an array of arrays as 1st argument to
MainConfiguration, pass a sorted flat array of factories instead. -
Remove the
always_authenticate_before_grantingoption -
Remove the
UserPasswordEncoderCommandclass and the correspondinguser:encode-passwordcommand, useUserPasswordHashCommandanduser:hash-passwordinstead -
Remove the
security.encoder_factory.genericservice, thesecurity.encoder_factoryandSymfony\Component\Security\Core\Encoder\EncoderFactoryInterfacealiases, usesecurity.password_hasher_factoryandSymfony\Component\PasswordHasher\Hasher\PasswordHasherFactoryInterfaceinstead -
Remove the
security.user_password_encoder.genericservice, thesecurity.password_encoderand theSymfony\Component\Security\Core\Encoder\UserPasswordEncoderInterfacealiases, usesecurity.user_password_hasher,security.password_hasherandSymfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterfaceinstead -
The
security.authorization_checkerandsecurity.token_storageservices are now private -
Not setting the
enable_authenticator_manageroption totruenow throws an exception -
Remove the
security.authentication.provider.*services, use the new authenticator system instead -
Remove the
security.authentication.listener.*services, use the new authenticator system instead -
Remove the Guard component integration, use the new authenticator system instead
- Removed
ArrayDenormalizer::setSerializer(), callsetDenormalizer()instead. ArrayDenormalizerdoes not implementSerializerAwareInterfaceanymore.- The annotation classes cannot be constructed by passing an array of parameters as first argument anymore, use named arguments instead
- The
twigservice is now private.
-
Removed the
allowEmptyStringoption from theLengthconstraint.Before:
use Symfony\Component\Validator\Constraints as Assert; /** * @Assert\Length(min=5, allowEmptyString=true) */
After:
use Symfony\Component\Validator\Constraints as Assert; /** * @Assert\AtLeastOneOf({ * @Assert\Blank(), * @Assert\Length(min=5) * }) */
-
Removed the
NumberConstraintTraittrait. -
ValidatorBuilder::enableAnnotationMapping()does not accept a Doctrine annotation reader anymore.
Before:
$builder->enableAnnotationMapping($reader);After:
$builder->enableAnnotationMapping(true)
->setDoctrineAnnotationReader($reader);ValidatorBuilder::enableAnnotationMapping()won't automatically setup a Doctrine annotation reader anymore.
Before:
$builder->enableAnnotationMapping();After:
$builder->enableAnnotationMapping(true)
->addDefaultDoctrineAnnotationReader();- Remove
InvalidTokenConfigurationException
-
Added support for parsing numbers prefixed with
0oas octal numbers. -
Removed support for parsing numbers starting with
0as octal numbers. They will be parsed as strings. Prefix numbers with0oso that they are parsed as octal numbers.Before:
Yaml::parse('072');After:
Yaml::parse('0o72'); -
Removed support for using the
!php/objectand!php/consttags without a value.