2018-12-01 09:28:10 +00:00
UPGRADE FROM 4.2 to 4.3
=======================
2019-01-14 14:19:12 +00:00
BrowserKit
----------
2019-03-12 20:10:42 +00:00
* Renamed `Client` to `AbstractBrowser`
2019-01-14 14:42:11 +00:00
* Marked `Response` final.
2019-01-14 14:23:01 +00:00
* Deprecated `Response::buildHeader()`
2019-01-14 14:19:12 +00:00
* Deprecated `Response::getStatus()` , use `Response::getStatusCode()` instead
2018-11-15 20:07:46 +00:00
Cache
-----
* The `psr/simple-cache` dependency has been removed - run `composer require psr/simple-cache` if you need it.
* Deprecated all PSR-16 adapters, use `Psr16Cache` or `Symfony\Contracts\Cache\CacheInterface` implementations instead.
2019-03-13 16:05:30 +00:00
* Deprecated `SimpleCacheAdapter` , use `Psr16Adapter` instead.
2018-11-15 20:07:46 +00:00
2018-12-01 09:28:10 +00:00
Config
------
* Deprecated using environment variables with `cannotBeEmpty()` if the value is validated with `validate()`
2019-04-09 00:07:36 +01:00
* Deprecated the `root()` method in `TreeBuilder` , pass the root node information to the constructor instead
2019-01-02 16:21:45 +00:00
2018-07-02 19:21:13 +01:00
DependencyInjection
-------------------
* Deprecated support for non-string default env() parameters
Before:
```yaml
parameters:
env(NAME): 1.5
```
After:
```yaml
parameters:
env(NAME): '1.5'
```
2019-04-07 11:04:56 +01:00
Doctrine Bridge
---------------
* Passing an `IdReader` to the `DoctrineChoiceLoader` when the query cannot be optimized with single id field has been deprecated, pass `null` instead
* Not passing an `IdReader` to the `DoctrineChoiceLoader` when the query can be optimized with single id field has been deprecated
2019-04-10 15:52:01 +01:00
Dotenv
------
2019-04-11 02:29:28 +01:00
* First parameter of `Dotenv::__construct()` will be changed from `true` to `false` in Symfony 5.0. A deprecation warning
is triggered if no parameter is provided. Use `$usePutenv = true` to upgrade without breaking changes.
2019-04-10 15:52:01 +01:00
2018-10-18 21:44:28 +01:00
EventDispatcher
---------------
* The signature of the `EventDispatcherInterface::dispatch()` method should be updated to `dispatch($event, string $eventName = null)` , not doing so is deprecated
2019-03-29 18:41:30 +00:00
* The `Event` class has been deprecated, use `Symfony\Contracts\EventDispatcher\Event` instead
2018-10-18 21:44:28 +01:00
2018-10-04 11:32:57 +01:00
Form
----
2018-10-04 12:05:56 +01:00
* Using the `format` option of `DateType` and `DateTimeType` when the `html5` option is enabled is deprecated.
2019-07-03 10:53:08 +01:00
* Using names for buttons that do not start with a lowercase letter, a digit, or an underscore is deprecated and will lead to an
2018-10-24 14:24:37 +01:00
exception in 5.0.
* Using names for buttons that do not contain only letters, digits, underscores, hyphens, and colons is deprecated and
will lead to an exception in 5.0.
2018-10-04 11:32:57 +01:00
* Using the `date_format` , `date_widget` , and `time_widget` options of the `DateTimeType` when the `widget` option is
set to `single_text` is deprecated.
2019-01-02 16:21:45 +00:00
FrameworkBundle
---------------
* Not passing the project directory to the constructor of the `AssetsInstallCommand` is deprecated. This argument will
be mandatory in 5.0.
2018-11-15 20:07:46 +00:00
* Deprecated the "Psr\SimpleCache\CacheInterface" / "cache.app.simple" service, use "Symfony\Contracts\Cache\CacheInterface" / "cache.app" instead.
2019-02-27 08:03:04 +00:00
* The `generate()` method of the `UrlGenerator` class can return an empty string instead of null.
2019-01-20 18:13:41 +00:00
HttpFoundation
--------------
* The `MimeTypeGuesserInterface` and `ExtensionGuesserInterface` interfaces have been deprecated,
use `Symfony\Component\Mime\MimeTypesInterface` instead.
* The `MimeType` and `MimeTypeExtensionGuesser` classes have been deprecated,
use `Symfony\Component\Mime\MimeTypes` instead.
* The `FileBinaryMimeTypeGuesser` class has been deprecated,
use `Symfony\Component\Mime\FileBinaryMimeTypeGuesser` instead.
* The `FileinfoMimeTypeGuesser` class has been deprecated,
use `Symfony\Component\Mime\FileinfoMimeTypeGuesser` instead.
2018-07-08 15:43:43 +01:00
2019-03-12 20:10:42 +00:00
HttpKernel
----------
2018-10-18 21:44:28 +01:00
* Renamed `Client` to `HttpKernelBrowser`
* Renamed `FilterControllerArgumentsEvent` to `ControllerArgumentsEvent`
* Renamed `FilterControllerEvent` to `ControllerEvent`
* Renamed `FilterResponseEvent` to `ResponseEvent`
* Renamed `GetResponseEvent` to `RequestEvent`
* Renamed `GetResponseForControllerResultEvent` to `ViewEvent`
* Renamed `GetResponseForExceptionEvent` to `ExceptionEvent`
* Renamed `PostResponseEvent` to `TerminateEvent`
2018-10-10 23:18:00 +01:00
* Deprecated `TranslatorListener` in favor of `LocaleAwareListener`
2019-03-12 20:10:42 +00:00
2018-10-12 20:48:56 +01:00
Intl
----
* Deprecated `ResourceBundle` namespace
* Deprecated `Intl::getCurrencyBundle()` , use `Currencies` instead
* Deprecated `Intl::getLanguageBundle()` , use `Languages` or `Scripts` instead
* Deprecated `Intl::getLocaleBundle()` , use `Locales` instead
2019-05-01 18:05:41 +01:00
* Deprecated `Intl::getRegionBundle()` , use `Countries` instead
2018-10-12 20:48:56 +01:00
2019-02-25 09:32:52 +00:00
Messenger
---------
* `Amqp` transport does not throw `\AMQPException` anymore, catch `TransportException` instead.
2019-03-12 18:04:35 +00:00
* Deprecated the `LoggingMiddleware` class, pass a logger to `SendMessageMiddleware` instead.
2019-02-25 09:32:52 +00:00
2019-02-26 18:18:56 +00:00
Routing
-------
* The `generator_base_class` , `generator_cache_class` , `matcher_base_class` , and `matcher_cache_class` router
options have been deprecated.
2019-06-05 10:11:58 +01:00
* `Serializable` implementing methods for `Route` and `CompiledRoute` are marked as `@internal` and `@final` .
Instead of overwriting them, use `__serialize` and `__unserialize` as extension points which are forward compatible
with the new serialization methods in PHP 7.4.
2019-02-26 18:18:56 +00:00
2019-01-30 13:28:33 +00:00
Security
--------
2017-03-06 17:12:20 +00:00
* The `Role` and `SwitchUserRole` classes are deprecated and will be removed in 5.0. Use strings for roles
instead.
2019-02-26 18:23:16 +00:00
* The `getReachableRoles()` method of the `RoleHierarchyInterface` is deprecated and will be removed in 5.0.
Role hierarchies must implement the `getReachableRoleNames()` method instead and return roles as strings.
2017-03-06 17:12:20 +00:00
* The `getRoles()` method of the `TokenInterface` is deprecated. Tokens must implement the `getRoleNames()`
method instead and return roles as strings.
2018-10-18 21:44:28 +01:00
* The `ListenerInterface` is deprecated, turn your listeners into callables instead.
* The `Firewall::handleRequest()` method is deprecated, use `Firewall::callListeners()` instead.
2019-01-30 13:28:33 +00:00
* The `AbstractToken::serialize()` , `AbstractToken::unserialize()` ,
`AuthenticationException::serialize()` and `AuthenticationException::unserialize()`
2019-04-07 09:37:59 +01:00
methods are now final, use `__serialize()` and `__unserialize()` instead.
2019-01-30 13:28:33 +00:00
Before:
```php
public function serialize()
{
return [$this->myLocalVar, parent::serialize()];
}
public function unserialize($serialized)
{
[$this->myLocalVar, $parentSerialized] = unserialize($serialized);
parent::unserialize($parentSerialized);
}
```
After:
```php
2019-04-07 09:37:59 +01:00
public function __serialize(): array
2019-01-30 13:28:33 +00:00
{
2019-04-07 09:37:59 +01:00
return [$this->myLocalVar, parent::__serialize()];
2019-01-30 13:28:33 +00:00
}
2019-04-07 09:37:59 +01:00
public function __unserialize(array $data): void
2019-01-30 13:28:33 +00:00
{
[$this->myLocalVar, $parentData] = $data;
2019-04-07 09:37:59 +01:00
parent::__unserialize($parentData);
2019-01-30 13:28:33 +00:00
}
```
2019-04-08 18:01:45 +01:00
* The `Argon2iPasswordEncoder` class has been deprecated, use `SodiumPasswordEncoder` instead.
2019-04-18 16:20:05 +01:00
* The `BCryptPasswordEncoder` class has been deprecated, use `NativePasswordEncoder` instead.
2019-04-08 13:17:08 +01:00
* Not implementing the methods `__serialize` and `__unserialize` in classes implementing
the `TokenInterface` is deprecated
2018-12-17 14:40:40 +00:00
SecurityBundle
--------------
2019-04-18 16:20:05 +01:00
* Configuring encoders using `argon2i` or `bcrypt` as algorithm has been deprecated, use `auto` instead.
2018-12-17 14:40:40 +00:00
2019-04-07 10:00:56 +01:00
TwigBridge
2018-12-17 14:40:40 +00:00
----------
2019-04-07 10:00:56 +01:00
2019-04-11 02:29:28 +01:00
* deprecated the `$requestStack` and `$requestContext` arguments of the
2019-04-07 10:00:56 +01:00
`HttpFoundationExtension` , pass a `Symfony\Component\HttpFoundation\UrlHelper`
instance as the only argument instead
2019-03-06 20:59:33 +00:00
Workflow
--------
2019-04-07 14:00:07 +01:00
* `initial_place` is deprecated in favour of `initial_marking` .
2019-03-06 20:59:33 +00:00
Before:
```yaml
framework:
workflows:
article:
initial_place: draft
```
After:
```yaml
framework:
workflows:
article:
2019-04-07 14:00:07 +01:00
initial_marking: [draft]
2019-03-06 20:59:33 +00:00
```
2019-03-12 09:26:19 +00:00
* `MarkingStoreInterface::setMarking()` will have a third argument in Symfony 5.0.
Before:
```php
class MyMarkingStore implements MarkingStoreInterface
{
public function setMarking($subject, Marking $marking)
{
}
}
```
After:
```php
class MyMarkingStore implements MarkingStoreInterface
{
public function setMarking($subject, Marking $marking , array $context = [])
{
}
}
```
2019-03-13 16:02:04 +00:00
* `MultipleStateMarkingStore` is deprecated. Use `MethodMarkingStore` instead.
Before:
```yaml
framework:
workflows:
article:
2019-07-01 20:17:30 +01:00
type: workflow
2019-03-13 16:02:04 +00:00
marking_store:
2019-07-01 20:17:30 +01:00
type: multiple_state
2019-03-23 19:20:32 +00:00
arguments: states
2019-03-13 16:02:04 +00:00
```
After:
```yaml
framework:
workflows:
article:
2019-07-01 20:17:30 +01:00
type: workflow
2019-03-13 16:02:04 +00:00
marking_store:
type: method
2019-03-23 19:20:32 +00:00
property: states
2019-03-13 16:02:04 +00:00
```
* `SingleStateMarkingStore` is deprecated. Use `MethodMarkingStore` instead.
Before:
```yaml
framework:
workflows:
article:
marking_store:
2019-03-23 19:20:32 +00:00
arguments: state
2019-03-13 16:02:04 +00:00
```
After:
```yaml
framework:
workflows:
article:
2019-07-01 20:17:30 +01:00
type: state_machine
2019-03-13 16:02:04 +00:00
marking_store:
type: method
2019-03-23 19:20:32 +00:00
property: state
2019-03-13 16:02:04 +00:00
```
2019-03-23 19:20:32 +00:00
2019-04-06 14:32:53 +01:00
* Using a workflow with a single state marking is deprecated. Use a state machine instead.
Before:
```yaml
framework:
workflows:
article:
type: workflow
marking_store:
type: single_state
```
After:
```yaml
framework:
workflows:
article:
type: state_machine
marking_store:
# type: single_state # Since the single_state marking store is deprecated, use method instead
type: method
```
2019-06-28 14:01:48 +01:00
* Using `DefinitionBuilder::setInitialPlace()` is deprecated, use `DefinitionBuilder::setInitialPlaces()` instead.
2019-03-23 19:20:32 +00:00
Yaml
----
* Using a mapping inside a multi-line string is deprecated and will throw a `ParseException` in 5.0.