17eaad20d1
* 5.2: Cleanup CI scripts use the clock mock to make test more resilient fix code style fix code style take query and request parameters into account when matching routes mistake throw type error when incompatible types are passed fix tests to run assertions on returned Crawler instances [FrameworkBundle] Fix UidNormalizer priority propagate groups to nested constraints
11 KiB
11 KiB
UPGRADE FROM 5.x to 6.0
Asset
- Removed
RemoteJsonManifestVersionStrategy
, useJsonManifestVersionStrategy
instead.
Config
- 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.
Console
Command::setHidden()
has a default value (true
) for$hidden
parameter
DependencyInjection
- 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\ContainerInterface
andSymfony\Component\DependencyInjection\ContainerInterface
aliases of theservice_container
service, 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
DomCrawler
- Removed the
parents()
method, useancestors()
instead.
Dotenv
- Removed argument
$usePutenv
from Dotenv's constructor, useDotenv::usePutenv()
instead.
EventDispatcher
- Removed
LegacyEventDispatcherProxy
. Use the event dispatcher without the proxy.
Form
- The default value of the
rounding_mode
option of thePercentType
has been changed to\NumberFormatter::ROUND_HALFUP
. - The default rounding mode of the
PercentToLocalizedStringTransformer
has been changed to\NumberFormatter::ROUND_HALFUP
. - Added the
getIsEmptyCallback()
method to theFormConfigInterface
. - Added the
setIsEmptyCallback()
method to theFormConfigBuilderInterface
. - Added argument
callable|null $filter
toChoiceListFactoryInterface::createListFromChoices()
andcreateListFromLoader()
. - The
Symfony\Component\Form\Extension\Validator\Util\ServerParams
class has been removed, use its parentSymfony\Component\Form\Util\ServerParams
instead. - The
NumberToLocalizedStringTransformer::ROUND_*
constants have been removed, use\NumberFormatter::ROUND_*
instead. - Removed
PropertyPathMapper
in favor ofDataMapper
andPropertyPathAccessor
. - Changed
$forms
parameter type of theDataMapper::mapDataToForms()
method fromiterable
to\Traversable
. - Changed
$forms
parameter type of theDataMapper::mapFormsToData()
method fromiterable
to\Traversable
. - Changed
$checkboxes
parameter type of theCheckboxListMapper::mapDataToForms()
method fromiterable
to\Traversable
. - Changed
$checkboxes
parameter type of theCheckboxListMapper::mapFormsToData()
method fromiterable
to\Traversable
. - Changed
$radios
parameter type of theRadioListMapper::mapDataToForms()
method fromiterable
to\Traversable
. - Changed
$radios
parameter type of theRadioListMapper::mapFormsToData()
method fromiterable
to\Traversable
.
FrameworkBundle
MicroKernelTrait::configureRoutes()
is now always called with aRoutingConfigurator
- The "framework.router.utf8" configuration option defaults to
true
- Removed
session.attribute_bag
service andsession.flash_bag
service. - The
form.factory
,form.type.file
,translator
,security.csrf.token_manager
,serializer
,cache_clearer
,filesystem
andvalidator
services are now private. - Removed the
lock.RESOURCE_NAME
andlock.RESOURCE_NAME.store
services and thelock
,LockInterface
,lock.store
andPersistingStoreInterface
aliases, uselock.RESOURCE_NAME.factory
,lock.factory
orLockFactory
instead.
HttpFoundation
- Removed
Response::create()
,JsonResponse::create()
,RedirectResponse::create()
,StreamedResponse::create()
andBinaryFileResponse::create()
methods (use__construct()
instead) - Not passing a
Closure
together withFILTER_CALLBACK
toParameterBag::filter()
throws anInvalidArgumentException
; wrap your filter in a closure instead. - Removed the
Request::HEADER_X_FORWARDED_ALL
constant, use eitherRequest::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO
orRequest::HEADER_X_FORWARDED_AWS_ELB
orRequest::HEADER_X_FORWARDED_TRAEFIK
constants instead.
HttpKernel
- Made
WarmableInterface::warmUp()
return a list of classes or files to preload on PHP 7.4+ - Removed support for
service:action
syntax to reference controllers. UseserviceOrFqcn::method
instead.
Inflector
- The component has been removed, use
EnglishInflector
from the String component instead.
Lock
- Removed the
NotSupportedException
. It shouldn't be thrown anymore. - Removed the
RetryTillSaveStore
. Logic has been moved inLock
and is not needed anymore.
Mailer
- Removed the
SesApiTransport
class. UseSesApiAsyncAwsTransport
instead. - Removed the
SesHttpTransport
class. UseSesHttpAsyncAwsTransport
instead.
Messenger
- Removed AmqpExt transport. Run
composer require symfony/amqp-messenger
to keep the transport in your application. - Removed Doctrine transport. Run
composer require symfony/doctrine-messenger
to keep the transport in your application. - Removed RedisExt transport. Run
composer require symfony/redis-messenger
to 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_count
parameter in the AMQP bridge.
Mime
- Removed
Address::fromString()
, useAddress::create()
instead
Monolog
- The
$actionLevel
constructor argument ofSymfony\Bridge\Monolog\Handler\FingersCrossed\NotFoundActivationStrategy
has been replaced by the$inner
one which expects an ActivationStrategyInterface to decorate instead.Symfony\Bridge\Monolog\Handler\FingersCrossed\NotFoundActivationStrategy
is now final. - The
$actionLevel
constructor argument ofSymfony\Bridge\Monolog\Handler\FingersCrossed\HttpCodeActivationStrategy
has been replaced by the$inner
one which expects an ActivationStrategyInterface to decorate instead.Symfony\Bridge\Monolog\Handler\FingersCrossed\HttpCodeActivationStrategy
is now final.
OptionsResolver
- The signature of method
OptionsResolver::setDeprecated()
has been updated toOptionsResolver::setDeprecated(string $option, string $package, string $version, $message)
. - Removed
OptionsResolverIntrospector::getDeprecationMessage()
, useOptionsResolverIntrospector::getDeprecation()
instead.
PhpUnitBridge
- Removed support for
@expectedDeprecation
annotations, use theExpectDeprecationTrait::expectDeprecation()
method instead. - Removed the
SetUpTearDownTrait
trait, use original methods with "void" return typehint.
PropertyAccess
- Dropped support for booleans as the first argument of
PropertyAccessor::__construct()
. Pass a combination of bitwise flags instead.
PropertyInfo
- Dropped the
enable_magic_call_extraction
context option inReflectionExtractor::getWriteInfo()
andReflectionExtractor::getReadInfo()
in favor ofenable_magic_methods_extraction
.
Routing
- Removed
RouteCollectionBuilder
. - Added argument
$priority
toRouteCollection::add()
- Removed the
RouteCompiler::REGEX_DELIMITER
constant
Security
- Removed
ROLE_PREVIOUS_ADMIN
role in favor ofIS_IMPERSONATOR
attribute - Removed
LogoutSuccessHandlerInterface
andLogoutHandlerInterface
, register a listener on theLogoutEvent
event instead. - Removed
DefaultLogoutSuccessHandler
in 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::$providerKey
property in favor ofAbstractRememberMeServices::$firewallName
AccessDecisionManager
now throw an exception when a voter does not return a valid decision.
Serializer
- Removed
ArrayDenormalizer::setSerializer()
, callsetDenormalizer()
instead. ArrayDenormalizer
does not implementSerializerAwareInterface
anymore.
TwigBundle
- The
twig
service is now private.
Validator
-
Removed the
allowEmptyString
option from theLength
constraint.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
NumberConstraintTrait
trait. -
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();
Yaml
-
Added support for parsing numbers prefixed with
0o
as octal numbers. -
Removed support for parsing numbers starting with
0
as octal numbers. They will be parsed as strings. Prefix numbers with0o
so that they are parsed as octal numbers.Before:
Yaml::parse('072');
After:
Yaml::parse('0o72');
-
Removed support for using the
!php/object
and!php/const
tags without a value.