2019-05-19 12:51:44 +01:00
UPGRADE FROM 4.3 to 4.4
=======================
2019-06-25 16:29:23 +01:00
Cache
-----
* Added argument `$prefix` to `AdapterInterface::clear()`
2019-07-10 03:50:49 +01:00
Debug
-----
2019-08-08 08:36:09 +01:00
* Deprecated the `Debug` class, use the one from the `ErrorRenderer` component instead
* Deprecated the `FlattenException` class, use the one from the `ErrorRenderer` component instead
* Deprecated the component in favor of the `ErrorHandler` component
2019-07-10 03:50:49 +01:00
2019-05-19 12:51:44 +01:00
DependencyInjection
-------------------
* Deprecated support for short factories and short configurators in Yaml
Before:
```yaml
services:
my_service:
factory: factory_service:method
```
After:
```yaml
services:
my_service:
factory: ['@factory_service', method]
```
2019-04-29 22:59:34 +01:00
* Deprecated `tagged` in favor of `tagged_iterator`
Before:
```yaml
services:
App\Handler:
tags: ['app.handler']
2019-06-28 14:18:47 +01:00
2019-04-29 22:59:34 +01:00
App\HandlerCollection:
arguments: [!tagged app.handler]
```
After:
```yaml
services:
App\Handler:
tags: ['app.handler']
2019-06-28 14:18:47 +01:00
2019-04-29 22:59:34 +01:00
App\HandlerCollection:
arguments: [!tagged_iterator app.handler]
```
2019-05-29 13:39:34 +01:00
2019-07-05 10:51:03 +01:00
* Passing an instance of `Symfony\Component\DependencyInjection\Parameter` as class name to `Symfony\Component\DependencyInjection\Definition` is deprecated.
Before:
```php
new Definition(new Parameter('my_class'));
```
After:
```php
new Definition('%my_class%');
```
2019-07-30 18:32:27 +01:00
DoctrineBridge
--------------
* Deprecated injecting `ClassMetadataFactory` in `DoctrineExtractor` , an instance of `EntityManagerInterface` should be
injected instead.
* Deprecated passing an `IdReader` to the `DoctrineChoiceLoader` when the query cannot be optimized with single id field.
* Deprecated not passing an `IdReader` to the `DoctrineChoiceLoader` when the query can be optimized with single id field.
* Deprecated `RegistryInterface` , use `Doctrine\Common\Persistence\ManagerRegistry` .
2019-07-05 10:51:03 +01:00
2019-07-02 07:30:32 +01:00
Filesystem
----------
* Support for passing a `null` value to `Filesystem::isAbsolutePath()` is deprecated.
2019-06-07 11:53:37 +01:00
Form
----
2019-07-24 15:46:11 +01:00
* Using different values for the "model_timezone" and "view_timezone" options of the `TimeType` without configuring a
reference date is deprecated.
2019-06-07 11:53:37 +01:00
* Using `int` or `float` as data for the `NumberType` when the `input` option is set to `string` is deprecated.
2019-08-09 08:43:48 +01:00
* Overriding the methods `FormIntegrationTestCase::setUp()` , `TypeTestCase::setUp()` and `TypeTestCase::tearDown()` without the `void` return-type is deprecated.
2019-06-07 11:53:37 +01:00
2019-05-30 16:17:31 +01:00
FrameworkBundle
---------------
2019-07-13 17:25:19 +01:00
* Deprecated booting the kernel before running `WebTestCase::createClient()` .
2019-06-21 11:17:48 +01:00
* Deprecated support for `templating` engine in `TemplateController` , use Twig instead
2019-06-04 06:54:11 +01:00
* The `$parser` argument of `ControllerResolver::__construct()` and `DelegatingLoader::__construct()`
has been deprecated.
* The `ControllerResolver` and `DelegatingLoader` classes have been marked as `final` .
* The `controller_name_converter` and `resolve_controller_name_subscriber` services have been deprecated.
2019-07-17 13:55:17 +01:00
* Deprecated `routing.loader.service` , use `routing.loader.container` instead.
2019-07-18 07:35:24 +01:00
* Not tagging service route loaders with `routing.route_loader` has been deprecated.
2019-08-09 08:43:48 +01:00
* Overriding the methods `KernelTestCase::tearDown()` and `WebTestCase::tearDown()` without the `void` return-type is deprecated.
2019-06-21 11:17:48 +01:00
HttpClient
----------
* Added method `cancel()` to `ResponseInterface`
2019-06-28 14:18:47 +01:00
HttpFoundation
--------------
* `ApacheRequest` is deprecated, use `Request` class instead.
2019-06-20 20:59:08 +01:00
* Passing a third argument to `HeaderBag::get()` is deprecated since Symfony 4.4, use method `all()` instead
2019-06-28 14:18:47 +01:00
2019-06-21 11:17:48 +01:00
HttpKernel
----------
* The `DebugHandlersListener` class has been marked as `final`
2019-08-01 03:33:32 +01:00
* Added new Bundle directory convention consistent with standard skeletons:
```
└── MyBundle/
├── config/
├── public/
├── src/
│ └── MyBundle.php
├── templates/
└── translations/
```
To make this work properly, it is necessary to change the root path of the bundle:
```php
class MyBundle extends Bundle
{
public function getPath(): string
{
return \dirname(__DIR__);
}
}
```
As many bundles must be compatible with a range of Symfony versions, the current
directory convention is not deprecated yet, but it will be in the future.
2019-06-21 11:17:48 +01:00
2019-07-13 17:25:19 +01:00
Lock
----
* Deprecated `Symfony\Component\Lock\StoreInterface` in favor of `Symfony\Component\Lock\BlockingStoreInterface` and
2019-07-11 04:40:49 +01:00
`Symfony\Component\Lock\PersistingStoreInterface` .
2019-07-12 08:14:40 +01:00
* `Factory` is deprecated, use `LockFactory` instead
2019-07-13 17:25:19 +01:00
2019-06-01 13:56:25 +01:00
Messenger
---------
* Deprecated passing a `ContainerInterface` instance as first argument of the `ConsumeMessagesCommand` constructor,
pass a `RoutableMessageBus` instance instead.
2019-05-29 18:05:37 +01:00
MonologBridge
--------------
2019-06-01 13:56:25 +01:00
* The `RouteProcessor` has been marked final.
2019-07-10 08:40:26 +01:00
Process
-------
* Deprecated the `Process::inheritEnvironmentVariables()` method: env variables are always inherited.
2019-05-29 18:05:37 +01:00
2019-06-28 18:05:52 +01:00
PropertyAccess
--------------
* Deprecated passing `null` as 2nd argument of `PropertyAccessor::createCache()` method (`$defaultLifetime`), pass `0` instead.
2019-07-17 13:55:17 +01:00
Routing
-------
* Deprecated `ServiceRouterLoader` in favor of `ContainerLoader` .
* Deprecated `ObjectRouteLoader` in favor of `ObjectLoader` .
2019-04-17 20:13:54 +01:00
Security
--------
2019-07-31 03:17:21 +01:00
* The `LdapUserProvider` class has been deprecated, use `Symfony\Component\Ldap\Security\LdapUserProvider` instead.
2019-04-17 20:13:54 +01:00
* Implementations of `PasswordEncoderInterface` and `UserPasswordEncoderInterface` should add a new `needsRehash()` method
2019-07-06 15:12:52 +01:00
Stopwatch
---------
* Deprecated passing `null` as 1st (`$id`) argument of `Section::get()` method, pass a valid child section identifier instead.
2019-05-29 13:39:34 +01:00
TwigBridge
----------
2019-06-28 14:18:47 +01:00
* Deprecated to pass `$rootDir` and `$fileLinkFormatter` as 5th and 6th argument respectively to the
2019-06-01 13:56:25 +01:00
`DebugCommand::__construct()` method, swap the variables position.
2019-07-22 18:18:46 +01:00
TwigBundle
----------
* Deprecated default value `twig.controller.exception::showAction` of the `twig.exception_controller` configuration option,
set it to `null` instead. This will also change the default error response format according to https://tools.ietf.org/html/rfc7807
for `json` , `xml` , `atom` and `txt` formats:
Before:
```json
{
"error": {
"code": 404,
"message": "Sorry, the page you are looking for could not be found"
}
}
```
After:
```json
{
"title": "Not Found",
"status": 404,
"detail": "Sorry, the page you are looking for could not be found"
}
```
* Deprecated the `ExceptionController` and all built-in error templates, use the error renderer mechanism of the `ErrorRenderer` component
* Deprecated loading custom error templates in non-html formats. Custom HTML error pages based on Twig keep working as before:
Before (`templates/bundles/TwigBundle/Exception/error.jsonld.twig`):
```twig
{
"@id": "https://example.com",
"@type": "error",
"@context": {
"title": "{{ status_text }}",
"code": {{ status_code }},
"message": "{{ exception.message }}"
}
}
```
After (`App\ErrorRenderer\JsonLdErrorRenderer`):
```php
class JsonLdErrorRenderer implements ErrorRendererInterface
{
public static function getFormat(): string
{
return 'jsonld';
}
public function render(FlattenException $exception): string
{
return json_encode([
'@id' => 'https://example.com',
'@type' => 'error',
'@context' => [
'title' => $exception->getTitle(),
'code' => $exception->getStatusCode(),
'message' => $exception->getMessage(),
],
]);
}
}
```
Configure your rendering service tagging it with `error_renderer.renderer` .
2019-06-14 09:27:35 +01:00
Validator
---------
2019-06-28 14:18:47 +01:00
* Deprecated passing an `ExpressionLanguage` instance as the second argument of `ExpressionValidator::__construct()` .
2019-06-28 17:16:38 +01:00
* Deprecated using anything else than a `string` as the code of a `ConstraintViolation` , a `string` type-hint will
be added to the constructor of the `ConstraintViolation` class and to the `ConstraintViolationBuilder::setCode()`
method in 5.0.
2019-06-14 09:27:35 +01:00
* Deprecated passing an `ExpressionLanguage` instance as the second argument of `ExpressionValidator::__construct()` .
Pass it as the first argument instead.
2019-05-22 10:46:46 +01:00
* The `Length` constraint expects the `allowEmptyString` option to be defined
when the `min` option is used.
Set it to `true` to keep the current behavior and `false` to reject empty strings.
In 5.0, it'll become optional and will default to `false` .
2019-08-09 08:43:48 +01:00
* Overriding the methods `ConstraintValidatorTestCase::setUp()` and `ConstraintValidatorTestCase::tearDown()` without the `void` return-type is deprecated.
2019-07-09 16:22:11 +01:00
WebProfilerBundle
-----------------
2019-07-24 00:59:27 +01:00
* Deprecated the `ExceptionController` class in favor of `ExceptionErrorController`
2019-07-09 16:22:11 +01:00
* Deprecated the `TemplateManager::templateExists()` method
2019-07-13 17:25:19 +01:00
WebServerBundle
---------------
* The bundle is deprecated and will be removed in 5.0.