This PR was merged into the 4.2-dev branch.
Discussion
----------
[Validator] Add BC layer covering BicValidator without Intl
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/28473#pullrequestreview-158620738
| License | MIT
| Doc PR | n/a
Commits
-------
10b8a5f041
[Validator] Add BC layer covering BicValidator without Intl
8.0 KiB
UPGRADE FROM 4.x to 5.0
BrowserKit
- The
Client::submit()
method has a new$serverParameters
argument.
Cache
- Removed
CacheItem::getPreviousTags()
, useCacheItem::getMetadata()
instead.
Config
- Dropped support for constructing a
TreeBuilder
without passing root node information. - Added the
getChildNodeDefinitions()
method toParentNodeDefinitionInterface
. - The
Processor
class has been made final - Removed
FileLoaderLoadException
, useLoaderLoadException
instead.
Console
-
Removed the
setCrossingChar()
method in favor of thesetDefaultCrossingChar()
method inTableStyle
. -
Removed the
setHorizontalBorderChar()
method in favor of thesetDefaultCrossingChars()
method inTableStyle
. -
Removed the
getHorizontalBorderChar()
method in favor of thegetBorderChars()
method inTableStyle
. -
Removed the
setVerticalBorderChar()
method in favor of thesetVerticalBorderChars()
method inTableStyle
. -
Removed the
getVerticalBorderChar()
method in favor of thegetBorderChars()
method inTableStyle
. -
The
ProcessHelper::run()
method takes the command as an array of arguments.Before:
$processHelper->run($output, 'ls -l');
After:
$processHelper->run($output, array('ls', '-l')); // alternatively, when a shell wrapper is required $processHelper->run($output, Process::fromShellCommandline('ls -l'));
DependencyInjection
- Removed the
TypedReference::canBeAutoregistered()
andTypedReference::getRequiringClass()
methods. - Removed support for auto-discovered extension configuration class which does not implement
ConfigurationInterface
.
DoctrineBridge
- Deprecated injecting
ClassMetadataFactory
inDoctrineExtractor
, an instance ofEntityManagerInterface
should be injected instead
DomCrawler
- The
Crawler::children()
method has a new$selector
argument.
EventDispatcher
- The
TraceableEventDispatcherInterface
has been removed.
Finder
- The
Finder::sortByName()
method has a new$useNaturalSort
argument.
Form
- The
scale
option was removed from theIntegerType
. - The
$scale
argument of theIntegerToLocalizedStringTransformer
was removed.
FrameworkBundle
-
Removed support for
bundle:controller:action
andservice:action
syntaxes to reference controllers. UseserviceOrFqcn::method
instead whereserviceOrFqcn
is either the service ID when using controllers as services or the FQCN of the controller.Before:
bundle_controller: path: / defaults: _controller: FrameworkBundle:Redirect:redirect service_controller: path: / defaults: _controller: app.my_controller:myAction
After:
bundle_controller: path: / defaults: _controller: Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction service_controller: path: / defaults: _controller: app.my_controller::myAction
-
Removed
Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser
. -
Warming up a router in
RouterCacheWarmer
that does not implement theWarmableInterface
is not supported anymore. -
The
RequestDataCollector
class has been removed. Use theSymfony\Component\HttpKernel\DataCollector\RequestDataCollector
class instead. -
Removed
Symfony\Bundle\FrameworkBundle\Controller\Controller
. UseSymfony\Bundle\FrameworkBundle\Controller\AbstractController
instead. -
Added support for the SameSite attribute for session cookies. It is highly recommended to set this setting (
framework.session.cookie_samesite
) tolax
for increased security against CSRF attacks. -
The
ContainerAwareCommand
class has been removed, useSymfony\Component\Console\Command\Command
with dependency injection instead.
HttpFoundation
- The
$size
argument of theUploadedFile
constructor has been removed. - The
getClientSize()
method of theUploadedFile
class has been removed. - The
getSession()
method of theRequest
class throws an exception when session is null. - The default value of the "$secure" and "$samesite" arguments of Cookie's constructor changed respectively from "false" to "null" and from "null" to "lax".
Monolog
- The methods
DebugProcessor::getLogs()
,DebugProcessor::countErrors()
,Logger::getLogs()
andLogger::countErrors()
have a new$request
argument.
Process
-
Removed the
Process::setCommandline()
and thePhpProcess::setPhpBinary()
methods. -
Commands must be defined as arrays when creating a
Process
instance.Before:
$process = new Process('ls -l');
After:
$process = new Process(array('ls', '-l')); // alternatively, when a shell wrapper is required $process = Process::fromShellCommandline('ls -l');
Security
- The
ContextListener::setLogoutOnUserChange()
method has been removed. - The
Symfony\Component\Security\Core\User\AdvancedUserInterface
has been removed. - The
ExpressionVoter::addExpressionLanguageProvider()
method has been removed. - The
FirewallMapInterface::getListeners()
method must return an array of 3 elements, the 3rd one must be either aLogoutListener
instance ornull
. - The
AuthenticationTrustResolver
constructor arguments have been removed. - A user object that is not an instance of
UserInterface
cannot be accessed fromSecurity::getUser()
anymore and returnsnull
instead.
SecurityBundle
- The
logout_on_user_change
firewall option has been removed. - The
switch_user.stateless
firewall option has been removed. - The
SecurityUserValueResolver
class has been removed. - Passing a
FirewallConfig
instance as 3rd argument to theFirewallContext
constructor now throws a\TypeError
, pass aLogoutListener
instance instead. - The
security.authentication.trust_resolver.anonymous_class
parameter has been removed. - The
security.authentication.trust_resolver.rememberme_class
parameter has been removed.
Serializer
- The
AbstractNormalizer::handleCircularReference()
method has two new$format
and$context
arguments.
Translation
- The
FileDumper::setBackup()
method has been removed. - The
TranslationWriter::disableBackup()
method has been removed. - The
TranslatorInterface
has been removed in favor ofSymfony\Contracts\Translation\TranslatorInterface
- The
MessageSelector
,Interval
andPluralizationRules
classes have been removed, useIdentityTranslator
instead
TwigBundle
- The default value (
false
) of thetwig.strict_variables
configuration option has been changed to%kernel.debug%
.
Validator
- The
Email::__construct()
'strict' property has been removed. Use 'mode'=>"strict" instead. - Calling
EmailValidator::__construct()
method with a boolean parameter has been removed, useEmailValidator("strict")
instead. - Removed the
checkDNS
anddnsMessage
options from theUrl
constraint. - The component is now decoupled from
symfony/translation
and usesSymfony\Contracts\Translation\TranslatorInterface
instead - The
ValidatorBuilderInterface
has been removed andValidatorBuilder
is now final - Removed support for validating instances of
\DateTimeInterface
inDateTimeValidator
,DateValidator
andTimeValidator
. UseType
instead or remove the constraint if the underlying model is type hinted to\DateTimeInterface
already. - The
symfony/intl
component is now required for using theBic
constraint
Workflow
- The
DefinitionBuilder::reset()
method has been removed, use theclear()
one instead. add
method has been removed useaddWorkflow
method inWorkflow\Registry
instead.SupportStrategyInterface
has been removed, useWorkflowSupportStrategyInterface
instead.ClassInstanceSupportStrategy
has been removed, useInstanceOfSupportStrategy
instead.