1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240
|
UPGRADE FROM 7.0 to 7.1
=======================
Symfony 7.1 is a minor release. According to the Symfony release process, there should be no significant
backward compatibility breaks. Minor backward compatibility breaks are prefixed in this document with
`[BC BREAK]`, make sure your code is compatible with these entries before upgrading.
Read more about this in the [Symfony documentation](https://symfony.com/doc/7.1/setup/upgrade_minor.html).
If you're upgrading from a version below 7.0, follow the [7.0 upgrade guide](UPGRADE-7.0.md) first.
Table of Contents
-----------------
Bundles
* [FrameworkBundle](#FrameworkBundle)
* [SecurityBundle](#SecurityBundle)
* [TwigBundle](#TwigBundle)
Bridges
* [DoctrineBridge](#DoctrineBridge)
Components
* [AssetMapper](#AssetMapper)
* [Cache](#Cache)
* [DependencyInjection](#DependencyInjection)
* [ExpressionLanguage](#ExpressionLanguage)
* [Form](#Form)
* [Intl](#Intl)
* [HttpClient](#HttpClient)
* [HttpKernel](#HttpKernel)
* [Security](#Security)
* [Serializer](#Serializer)
* [Translation](#Translation)
* [Workflow](#Workflow)
AssetMapper
-----------
* Deprecate `ImportMapConfigReader::splitPackageNameAndFilePath()`, use `ImportMapEntry::splitPackageNameAndFilePath()` instead
Cache
-----
* Deprecate `CouchbaseBucketAdapter`, use `CouchbaseCollectionAdapter` with Couchbase 3 instead
* The algorithm for the default cache namespace changed from SHA256 to XXH128
DependencyInjection
-------------------
* [BC BREAK] When used in the `prependExtension()` method, the `ContainerConfigurator::import()` method now prepends the configuration instead of appending it
* Deprecate `#[TaggedIterator]` and `#[TaggedLocator]` attributes, use `#[AutowireIterator]` and `#[AutowireLocator]` instead
*Before*
```php
use Symfony\Component\DependencyInjection\Attribute\TaggedIterator;
use Symfony\Component\DependencyInjection\Attribute\TaggedLocator;
class HandlerCollection
{
public function __construct(
#[TaggedIterator('app.handler', indexAttribute: 'key')]
iterable $handlers,
#[TaggedLocator('app.handler')]
private ContainerInterface $locator,
) {
}
}
```
*After*
```php
use Symfony\Component\DependencyInjection\Attribute\AutowireIterator;
use Symfony\Component\DependencyInjection\Attribute\AutowireLocator;
class HandlerCollection
{
public function __construct(
#[AutowireIterator('app.handler', indexAttribute: 'key')]
iterable $handlers,
#[AutowireLocator('app.handler')]
private ContainerInterface $locator,
) {
}
}
```
DoctrineBridge
--------------
* Mark class `ProxyCacheWarmer` as `final`
ExpressionLanguage
------------------
* Deprecate passing `null` as the allowed variable names to `ExpressionLanguage::lint()` and `Parser::lint()`,
pass the `IGNORE_UNKNOWN_VARIABLES` flag instead to ignore unknown variables during linting
*Before*
```php
$expressionLanguage->lint('a + 1', null);
```
*After*
```php
use Symfony\Component\ExpressionLanguage\Parser;
$expressionLanguage->lint('a + 1', [], Parser::IGNORE_UNKNOWN_VARIABLES);
```
Form
----
* Deprecate not configuring the `default_protocol` option of the `UrlType`, it will default to `null` in 8.0 (the current default is `'http'`)
FrameworkBundle
---------------
* [BC BREAK] Enabling `framework.rate_limiter` requires `symfony/rate-limiter` 7.1 or higher
* Mark classes `ConfigBuilderCacheWarmer`, `Router`, `SerializerCacheWarmer`, `TranslationsCacheWarmer`, `Translator` and `ValidatorCacheWarmer` as `final`
* Deprecate the `router.cache_dir` config option, the Router will always use the `kernel.build_dir` parameter
* Reset env vars when resetting the container
HttpClient
----------
* Deprecate the `setLogger()` methods of the `NoPrivateNetworkHttpClient`, `TraceableHttpClient` and `ScopingHttpClient` classes, configure the logger of the wrapped clients directly instead
*Before*
```php
// ...
use Symfony\Component\HttpClient\HttpClient;
use Symfony\Component\HttpClient\NoPrivateNetworkHttpClient;
$publicClient = new NoPrivateNetworkHttpClient(HttpClient::create());
$publicClient->setLogger(new Logger());
```
*After*
```php
// ...
use Symfony\Component\HttpClient\HttpClient;
use Symfony\Component\HttpClient\NoPrivateNetworkHttpClient;
$client = HttpClient::create();
$client->setLogger(new Logger());
$publicClient = new NoPrivateNetworkHttpClient($client);
```
HttpKernel
----------
* The `Extension` class is marked as internal, extend the `Extension` class from the DependencyInjection component instead
* Deprecate `Extension::addAnnotatedClassesToCompile()`
* Deprecate `AddAnnotatedClassesToCachePass`
* Deprecate the `setAnnotatedClassCache()` and `getAnnotatedClassesToCompile()` methods of the `Kernel` class
* Deprecate the `addAnnotatedClassesToCompile()` and `getAnnotatedClassesToCompile()` methods of the `Extension` class
Intl
----
* [BC BREAK] Extracted `EmojiTransliterator` to a separate `symfony/emoji` component, the new FQCN is `Symfony\Component\Emoji\EmojiTransliterator`.
You must install the `symfony/emoji` component if you're using the old `EmojiTransliterator` class in the Intl component.
Mailer
------
* Postmark's "406 - Inactive recipient" API error code now results in a `PostmarkDeliveryEvent` instead of throwing a `HttpTransportException`
Security
--------
* Change the first and second argument of `OidcTokenHandler` to `Jose\Component\Core\AlgorithmManager` and `Jose\Component\Core\JWKSet` respectively
SecurityBundle
--------------
* Mark class `ExpressionCacheWarmer` as `final`
* Deprecate options `algorithm` and `key` of `oidc` token handler, use
`algorithms` and `keyset` instead
*Before*
```yaml
security:
firewalls:
main:
access_token:
token_handler:
oidc:
algorithm: 'ES256'
key: '{"kty":"...","k":"..."}'
# ...
```
*After*
```yaml
security:
firewalls:
main:
access_token:
token_handler:
oidc:
algorithms: ['ES256']
keyset: '{"keys":[{"kty":"...","k":"..."}]}'
# ...
```
* Deprecate the `security.access_token_handler.oidc.jwk` service, use `security.access_token_handler.oidc.jwkset` instead
Serializer
----------
* Deprecate the `withDefaultContructorArguments()` method of `AbstractNormalizerContextBuilder`, use `withDefaultConstructorArguments()` instead (note the typo in the old method name)
Translation
-----------
* Mark class `DataCollectorTranslator` as `final`
TwigBundle
----------
* Mark class `TemplateCacheWarmer` as `final`
* Deprecate the `base_template_class` config option, this option is no-op when using Twig 3+
Validator
---------
* Deprecate not passing a value for the `requireTld` option to the `Url` constraint (the default value will become `true` in 8.0)
* Deprecate `Bic::INVALID_BANK_CODE_ERROR`, as ISO 9362 defines no restrictions on BIC bank code characters
Workflow
--------
* Add method `getEnabledTransition()` to `WorkflowInterface`
* Add `$nbToken` argument to `Marking::mark()` and `Marking::unmark()`
|