This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/UPGRADE-5.0.md
Christophe Coevoet 453efdfe1e Undeprecate the single-colon notation for controllers
This notation is the only way to support controllers as services in the 3.4
LTS version.
This deprecation has only a very small benefit for the Symfony codebase (the
amount of code involved is very small), but has a huge cost for the community
which cannot avoid this deprecation without dropping support for the LTS or
making crazy logic to switch routing files (as they cannot switch things
inline in YAML or XML files).
This deprecation will be delayed until a future 5.x version, when the current
LTS will be 4.4 (which supports the new notation).
2018-11-15 10:34:05 +01:00

104 lines
3.8 KiB
Markdown

UPGRADE FROM 4.x to 5.0
=======================
Config
------
* Added the `getChildNodeDefinitions()` method to `ParentNodeDefinitionInterface`.
* The `Processor` class has been made final
Console
-------
* Removed the `setCrossingChar()` method in favor of the `setDefaultCrossingChar()` method in `TableStyle`.
* Removed the `setHorizontalBorderChar()` method in favor of the `setDefaultCrossingChars()` method in `TableStyle`.
* Removed the `getHorizontalBorderChar()` method in favor of the `getBorderChars()` method in `TableStyle`.
* Removed the `setVerticalBorderChar()` method in favor of the `setVerticalBorderChars()` method in `TableStyle`.
* Removed the `getVerticalBorderChar()` method in favor of the `getBorderChars()` method in `TableStyle`.
DependencyInjection
-------------------
* Removed the `TypedReference::canBeAutoregistered()` and `TypedReference::getRequiringClass()` methods.
* Removed support for auto-discovered extension configuration class which does not implement `ConfigurationInterface`.
EventDispatcher
---------------
* The `TraceableEventDispatcherInterface` has been removed.
FrameworkBundle
---------------
* Removed support for `bundle:controller:action` syntax to reference controllers. Use `serviceOrFqcn::method`
instead where `serviceOrFqcn` is either the service ID when using controllers as services or the FQCN of the controller.
Before:
```yml
bundle_controller:
path: /
defaults:
_controller: FrameworkBundle:Redirect:redirect
```
After:
```yml
bundle_controller:
path: /
defaults:
_controller: Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction
```
* Removed `Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser`.
* Warming up a router in `RouterCacheWarmer` that does not implement the `WarmableInterface` is not supported anymore.
* The `RequestDataCollector` class has been removed. Use the `Symfony\Component\HttpKernel\DataCollector\RequestDataCollector` class instead.
HttpFoundation
--------------
* The `$size` argument of the `UploadedFile` constructor has been removed.
* The `getClientSize()` method of the `UploadedFile` class has been removed.
* The `getSession()` method of the `Request` class throws an exception when session is null.
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.
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.
Translation
-----------
* The `FileDumper::setBackup()` method has been removed.
* The `TranslationWriter::disableBackup()` method has been removed.
TwigBundle
----------
* The default value (`false`) of the `twig.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, use `EmailValidator("strict")` instead.
* Removed the `checkDNS` and `dnsMessage` options from the `Url` constraint.
Workflow
--------
* The `DefinitionBuilder::reset()` method has been removed, use the `clear()` one instead.
* `add` method has been removed use `addWorkflow` method in `Workflow\Registry` instead.
* `SupportStrategyInterface` has been removed, use `WorkflowSupportStrategyInterface` instead.
* `ClassInstanceSupportStrategy` has been removed, use `InstanceOfSupportStrategy` instead.