Skip to content

Commit 935a84b

Browse files
committed
Add missing UPGRADE notes for 7.1
1 parent 31c597f commit 935a84b

File tree

5 files changed

+126
-16
lines changed

5 files changed

+126
-16
lines changed

UPGRADE-7.1.md

Lines changed: 124 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ Components
3030
* [Form](#Form)
3131
* [Intl](#Intl)
3232
* [HttpClient](#HttpClient)
33-
* [PropertyInfo](#PropertyInfo)
33+
* [HttpKernel](#HttpKernel)
34+
* [Security](#Security)
35+
* [Serializer](#Serializer)
3436
* [Translation](#Translation)
3537
* [Workflow](#Workflow)
3638

@@ -50,17 +52,66 @@ DependencyInjection
5052
* [BC BREAK] When used in the `prependExtension()` method, the `ContainerConfigurator::import()` method now prepends the configuration instead of appending it
5153
* Deprecate `#[TaggedIterator]` and `#[TaggedLocator]` attributes, use `#[AutowireIterator]` and `#[AutowireLocator]` instead
5254

55+
*Before*
56+
```php
57+
use Symfony\Component\DependencyInjection\Attribute\TaggedIterator;
58+
use Symfony\Component\DependencyInjection\Attribute\TaggedLocator;
59+
60+
class HandlerCollection
61+
{
62+
public function __construct(
63+
#[TaggedIterator('app.handler', indexAttribute: 'key')]
64+
iterable $handlers,
65+
66+
#[TaggedLocator('app.handler')]
67+
private ContainerInterface $locator,
68+
) {
69+
}
70+
}
71+
```
72+
73+
*After*
74+
```php
75+
use Symfony\Component\DependencyInjection\Attribute\AutowireIterator;
76+
use Symfony\Component\DependencyInjection\Attribute\AutowireLocator;
77+
78+
class HandlerCollection
79+
{
80+
public function __construct(
81+
#[AutowireIterator('app.handler', indexAttribute: 'key')]
82+
iterable $handlers,
83+
84+
#[AutowireLocator('app.handler')]
85+
private ContainerInterface $locator,
86+
) {
87+
}
88+
}
89+
```
90+
5391
DoctrineBridge
5492
--------------
5593

56-
* Deprecated `DoctrineExtractor::getTypes()`, use `DoctrineExtractor::getType()` instead
94+
* Deprecate `DoctrineExtractor::getTypes()`, use `DoctrineExtractor::getType()` instead
95+
* Mark class `ProxyCacheWarmer` as `final`
5796

5897
ExpressionLanguage
5998
------------------
6099

61100
* Deprecate passing `null` as the allowed variable names to `ExpressionLanguage::lint()` and `Parser::lint()`,
62101
pass the `IGNORE_UNKNOWN_VARIABLES` flag instead to ignore unknown variables during linting
63102

103+
*Before*
104+
```php
105+
$expressionLanguage->lint('a + 1', null);
106+
```
107+
108+
*After*
109+
```php
110+
use Symfony\Component\ExpressionLanguage\Parser;
111+
112+
$expressionLanguage->lint('a + 1', [], Parser::IGNORE_UNKNOWN_VARIABLES);
113+
```
114+
64115
Form
65116
----
66117

@@ -69,6 +120,7 @@ Form
69120
FrameworkBundle
70121
---------------
71122

123+
* [BC BREAK] Enabling `framework.rate_limiter` requires `symfony/rate-limiter` 7.1 or higher
72124
* Mark classes `ConfigBuilderCacheWarmer`, `Router`, `SerializerCacheWarmer`, `TranslationsCacheWarmer`, `Translator` and `ValidatorCacheWarmer` as `final`
73125
* Deprecate the `router.cache_dir` config option, the Router will always use the `kernel.build_dir` parameter
74126
* Reset env vars when resetting the container
@@ -78,6 +130,37 @@ HttpClient
78130

79131
* Deprecate the `setLogger()` methods of the `NoPrivateNetworkHttpClient`, `TraceableHttpClient` and `ScopingHttpClient` classes, configure the logger of the wrapped clients directly instead
80132

133+
*Before*
134+
```php
135+
// ...
136+
use Symfony\Component\HttpClient\HttpClient;
137+
use Symfony\Component\HttpClient\NoPrivateNetworkHttpClient;
138+
139+
$publicClient = new NoPrivateNetworkHttpClient(HttpClient::create());
140+
$publicClient->setLogger(new Logger());
141+
```
142+
143+
*After*
144+
```php
145+
// ...
146+
use Symfony\Component\HttpClient\HttpClient;
147+
use Symfony\Component\HttpClient\NoPrivateNetworkHttpClient;
148+
149+
$client = HttpClient::create();
150+
$client->setLogger(new Logger());
151+
152+
$publicClient = new NoPrivateNetworkHttpClient($client);
153+
```
154+
155+
HttpKernel
156+
----------
157+
158+
* The `Extension` class is marked as internal, extend the `Extension` class from the DependencyInjection component instead
159+
* Deprecate `Extension::addAnnotatedClassesToCompile()`
160+
* Deprecate `AddAnnotatedClassesToCachePass`
161+
* Deprecate the `setAnnotatedClassCache()` and `getAnnotatedClassesToCompile()` methods of the `Kernel` class
162+
* Deprecate the `addAnnotatedClassesToCompile()` and `getAnnotatedClassesToCompile()` methods of the `Extension` class
163+
81164
Intl
82165
----
83166

@@ -89,18 +172,49 @@ Mailer
89172

90173
* Postmark's "406 - Inactive recipient" API error code now results in a `PostmarkDeliveryEvent` instead of throwing a `HttpTransportException`
91174

92-
HttpKernel
93-
----------
175+
Security
176+
--------
94177

95-
* The `Extension` class is marked as internal, extend the `Extension` class from the DependencyInjection component instead
96-
* Deprecate `Extension::addAnnotatedClassesToCompile()`
97-
* Deprecate `AddAnnotatedClassesToCachePass`
98-
* Deprecate the `setAnnotatedClassCache()` and `getAnnotatedClassesToCompile()` methods of the `Kernel` class
178+
* Change the first and second argument of `OidcTokenHandler` to `Jose\Component\Core\AlgorithmManager` and `Jose\Component\Core\JWKSet` respectively
99179

100180
SecurityBundle
101181
--------------
102182

103183
* Mark class `ExpressionCacheWarmer` as `final`
184+
* Deprecate options `algorithm` and `key` of `oidc` token handler, use
185+
`algorithms` and `keyset` instead
186+
187+
*Before*
188+
```yaml
189+
security:
190+
firewalls:
191+
main:
192+
access_token:
193+
token_handler:
194+
oidc:
195+
algorithm: 'ES256'
196+
key: '{"kty":"...","k":"..."}'
197+
# ...
198+
```
199+
200+
*After*
201+
```yaml
202+
security:
203+
firewalls:
204+
main:
205+
access_token:
206+
token_handler:
207+
oidc:
208+
algorithms: ['ES256']
209+
keyset: '{"keys":[{"kty":"...","k":"..."}]}'
210+
# ...
211+
```
212+
* Deprecate the `security.access_token_handler.oidc.jwk` service, use `security.access_token_handler.oidc.jwkset` instead
213+
214+
Serializer
215+
----------
216+
217+
* Deprecate the `withDefaultContructorArguments()` method of `AbstractNormalizerContextBuilder`, use `withDefaultContructorArguments()` instead (note the typo in the old method name)
104218

105219
Translation
106220
-----------
@@ -111,12 +225,13 @@ TwigBundle
111225
----------
112226

113227
* Mark class `TemplateCacheWarmer` as `final`
228+
* Deprecate the `base_template_class` config option, this option is no-op when using Twig 3+
114229

115230
Validator
116231
---------
117232

118233
* Deprecate not passing a value for the `requireTld` option to the `Url` constraint (the default value will become `true` in 8.0)
119-
* Deprecate `Bic::INVALID_BANK_CODE_ERROR`
234+
* Deprecate `Bic::INVALID_BANK_CODE_ERROR`, as ISO 9362 defines no restrictions on BIC bank code characters
120235

121236
Workflow
122237
--------

src/Symfony/Component/ExpressionLanguage/ExpressionLanguage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function parse(Expression|string $expression, array $names, int $flags =
101101
public function lint(Expression|string $expression, ?array $names, int $flags = 0): void
102102
{
103103
if (null === $names) {
104-
trigger_deprecation('symfony/expression-language', '7.1', 'Passing "null" as the second argument of "%s()" is deprecated, pass "self::IGNORE_UNKNOWN_VARIABLES" instead as a third argument.', __METHOD__);
104+
trigger_deprecation('symfony/expression-language', '7.1', 'Passing "null" as the second argument of "%s()" is deprecated, pass "%s\Parser::IGNORE_UNKNOWN_VARIABLES" instead as a third argument.', __METHOD__, __NAMESPACE__);
105105

106106
$flags |= Parser::IGNORE_UNKNOWN_VARIABLES;
107107
$names = [];

src/Symfony/Component/ExpressionLanguage/Parser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function parse(TokenStream $stream, array $names = [], int $flags = 0): N
112112
public function lint(TokenStream $stream, ?array $names = [], int $flags = 0): void
113113
{
114114
if (null === $names) {
115-
trigger_deprecation('symfony/expression-language', '7.1', 'Passing "null" as the second argument of "%s()" is deprecated, pass "self::IGNORE_UNKNOWN_VARIABLES" instead as a third argument.', __METHOD__);
115+
trigger_deprecation('symfony/expression-language', '7.1', 'Passing "null" as the second argument of "%s()" is deprecated, pass "%s::IGNORE_UNKNOWN_VARIABLES" instead as a third argument.', __METHOD__, __CLASS__);
116116

117117
$flags |= self::IGNORE_UNKNOWN_VARIABLES;
118118
$names = [];

src/Symfony/Component/PropertyInfo/Extractor/ConstructorArgumentTypeExtractorInterface.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ interface ConstructorArgumentTypeExtractorInterface
2828
*
2929
* @return LegacyType[]|null
3030
*
31-
* @deprecated since Symfony 7.1, use "getTypeFromConstructor" instead
32-
*
3331
* @internal
3432
*/
3533
public function getTypesFromConstructor(string $class, string $property): ?array;

src/Symfony/Component/PropertyInfo/PropertyInfoCacheExtractor.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ public function getType(string $class, string $property, array $context = []): ?
6464
return $this->extract('getType', [$class, $property, $context]);
6565
}
6666

67-
/**
68-
* @deprecated since Symfony 7.1, use "getType" instead
69-
*/
7067
public function getTypes(string $class, string $property, array $context = []): ?array
7168
{
7269
return $this->extract('getTypes', [$class, $property, $context]);

0 commit comments

Comments
 (0)