Skip to content

Commit 878cda2

Browse files
Jean-Berunicolas-grekas
authored andcommitted
[FrameworkBundle] Deprecate not setting some options (uid, validation)
1 parent d6d233b commit 878cda2

31 files changed

+62
-14
lines changed

UPGRADE-6.4.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ FrameworkBundle
8080
* [BC break] Add native return type to `Translator` and to `Application::reset()`
8181
* Deprecate the integration of Doctrine annotations, either uninstall the `doctrine/annotations` package or disable
8282
the integration by setting `framework.annotations` to `false`
83+
* Deprecate not setting the `framework.uid.default_uuid_version` config option; it will default to `7` in 7.0
84+
* Deprecate not setting the `framework.uid.time_based_uuid_version` config option; it will default to `7` in 7.0
85+
* Deprecate not setting the `framework.validation.email_validation_mode` config option; it will default to `html5` in 7.0
8386

8487
HttpFoundation
8588
--------------

src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ CHANGELOG
1212
* Add `DomCrawlerAssertionsTrait::assertAnySelectorTextNotContains(string $selector, string $text)`
1313
* Deprecate `EnableLoggerDebugModePass`, use argument `$debug` of HttpKernel's `Logger` instead
1414
* Deprecate `AddDebugLogProcessorPass::configureLogger()`, use HttpKernel's `DebugLoggerConfigurator` instead
15+
* Deprecate not setting the `framework.uid.default_uuid_version` config option; it will default to `7` in 7.0
16+
* Deprecate not setting the `framework.uid.time_based_uuid_version` config option; it will default to `7` in 7.0
17+
* Deprecate not setting the `framework.validation.email_validation_mode` config option; it will default to `html5` in 7.0
1518

1619
6.3
1720
---

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -994,6 +994,15 @@ private function addTranslatorSection(ArrayNodeDefinition $rootNode, callable $e
994994
private function addValidationSection(ArrayNodeDefinition $rootNode, callable $enableIfStandalone): void
995995
{
996996
$rootNode
997+
->validate()
998+
->always(function ($v) {
999+
if ($v['validation']['enabled'] && !\array_key_exists('email_validation_mode', $v['validation'])) {
1000+
trigger_deprecation('symfony/framework-bundle', '6.4', 'Not setting the "framework.validation.email_validation_mode" config option is deprecated. It will default to "html5" in 7.0.');
1001+
}
1002+
1003+
return $v;
1004+
})
1005+
->end()
9971006
->children()
9981007
->arrayNode('validation')
9991008
->info('validation configuration')
@@ -2316,14 +2325,30 @@ private function addRateLimiterSection(ArrayNodeDefinition $rootNode, callable $
23162325
private function addUidSection(ArrayNodeDefinition $rootNode, callable $enableIfStandalone): void
23172326
{
23182327
$rootNode
2328+
->validate()
2329+
->always(function ($v) {
2330+
if ($v['uid']['enabled']) {
2331+
if (!\array_key_exists('default_uuid_version', $v['uid'])) {
2332+
trigger_deprecation('symfony/framework-bundle', '6.4', 'Not setting the "framework.uid.default_uuid_version" config option is deprecated. It will default to "7" in 7.0.');
2333+
}
2334+
2335+
if (!\array_key_exists('time_based_uuid_version', $v['uid'])) {
2336+
trigger_deprecation('symfony/framework-bundle', '6.4', 'Not setting the "framework.uid.time_based_uuid_version" config option is deprecated. It will default to "7" in 7.0.');
2337+
}
2338+
}
2339+
2340+
$v['uid'] += ['default_uuid_version' => 6, 'time_based_uuid_version' => 6];
2341+
2342+
return $v;
2343+
})
2344+
->end()
23192345
->children()
23202346
->arrayNode('uid')
23212347
->info('Uid configuration')
23222348
->{$enableIfStandalone('symfony/uid', UuidFactory::class)}()
23232349
->addDefaultsIfNotSet()
23242350
->children()
23252351
->enumNode('default_uuid_version')
2326-
->defaultValue(6)
23272352
->values([7, 6, 4, 1])
23282353
->end()
23292354
->enumNode('name_based_uuid_version')
@@ -2334,7 +2359,6 @@ private function addUidSection(ArrayNodeDefinition $rootNode, callable $enableIf
23342359
->cannotBeEmpty()
23352360
->end()
23362361
->enumNode('time_based_uuid_version')
2337-
->defaultValue(6)
23382362
->values([7, 6, 1])
23392363
->end()
23402364
->scalarNode('time_based_uuid_node')

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
],
5656
'validation' => [
5757
'enabled' => true,
58+
'email_validation_mode' => 'html5',
5859
],
5960
'annotations' => false,
6061
'serializer' => [

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_annotations.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
'validation' => [
88
'enabled' => true,
99
'enable_annotations' => true,
10+
'email_validation_mode' => 'html5',
1011
],
1112
]);
1213

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_auto_mapping.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
'http_method_override' => false,
66
'property_info' => ['enabled' => true],
77
'validation' => [
8+
'email_validation_mode' => 'html5',
89
'auto_mapping' => [
910
'App\\' => ['foo', 'bar'],
1011
'Symfony\\' => ['a', 'b'],

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_legacy_annotations.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
'validation' => [
1010
'enabled' => true,
1111
'enable_annotations' => true,
12+
'email_validation_mode' => 'html5',
1213
],
1314
]);
1415

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_mapping.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
'annotations' => false,
55
'http_method_override' => false,
66
'validation' => [
7+
'email_validation_mode' => 'html5',
78
'mapping' => [
89
'paths' => [
910
'%kernel.project_dir%/Fixtures/TestBundle/Resources/config/validation_mapping/files',

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_multiple_static_methods.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
'secret' => 's3cr3t',
77
'validation' => [
88
'enabled' => true,
9+
'email_validation_mode' => 'html5',
910
'static_method' => ['loadFoo', 'loadBar'],
1011
],
1112
]);

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_no_static_method.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
'secret' => 's3cr3t',
77
'validation' => [
88
'enabled' => true,
9+
'email_validation_mode' => 'html5',
910
'static_method' => false,
1011
],
1112
]);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy