Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd1c71de

Browse files
Jean-Berunicolas-grekas
authored andcommitted
[FrameworkBundle] Deprecate not setting some options (uid, validation)
1 parentd6d233b commitd1c71de

File tree

29 files changed

+61
-12
lines changed

29 files changed

+61
-12
lines changed

‎UPGRADE-6.4.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ 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
86+
8387

8488
HttpFoundation
8589
--------------

‎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
privatefunctionaddValidationSection(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
privatefunctionaddUidSection(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
]);

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_translation_domain.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
'translation_domain' =>'messages',
89
],
910
]);

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<framework:translatorenabled="true"fallback="fr"logging="true"cache-dir="%kernel.cache_dir%/translations">
3232
<framework:path>%kernel.project_dir%/Fixtures/translations</framework:path>
3333
</framework:translator>
34-
<framework:validationenabled="true" />
34+
<framework:validationenabled="true"email-validation-mode="html5"/>
3535
<framework:annotationsenabled="false" />
3636
<framework:serializerenabled="true"enable-annotations="true"name-converter="serializer.name_converter.camel_case_to_snake_case"circular-reference-handler="my.circular.reference.handler"max-depth-handler="my.max.depth.handler">
3737
<framework:default-context>

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/validation_annotations.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<framework:configsecret="s3cr3t"http-method-override="false">
1010
<framework:annotationsenabled="false" />
11-
<framework:validationenabled="true"enable-annotations="true" />
11+
<framework:validationenabled="true"enable-annotations="true"email-validation-mode="html5"/>
1212
</framework:config>
1313

1414
<services>

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/validation_auto_mapping.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<framework:confighttp-method-override="false">
77
<framework:annotationsenabled="false" />
88
<framework:property-infoenabled="true" />
9-
<framework:validation>
9+
<framework:validationemail-validation-mode="html5">
1010
<framework:auto-mappingnamespace="App\">
1111
<framework:service>foo</framework:service>
1212
<framework:service>bar</framework:service>

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/validation_legacy_annotations.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<framework:configsecret="s3cr3t"http-method-override="false">
1010
<framework:annotationsenabled="true" />
11-
<framework:validationenabled="true"enable-annotations="true" />
11+
<framework:validationenabled="true"enable-annotations="true"email-validation-mode="html5"/>
1212
</framework:config>
1313

1414
<services>

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/validation_mapping.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<framework:confighttp-method-override="false">
88
<framework:annotationsenabled="false" />
9-
<framework:validation>
9+
<framework:validationemail-validation-mode="html5">
1010
<framework:mapping>
1111
<framework:path>%kernel.project_dir%/Fixtures/TestBundle/Resources/config/validation_mapping/files</framework:path>
1212
<framework:path>%kernel.project_dir%/Fixtures/TestBundle/Resources/config/validation_mapping/validation.yml</framework:path>

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/validation_multiple_static_methods.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<framework:configsecret="s3cr3t"http-method-override="false">
1010
<framework:annotationsenabled="false" />
11-
<framework:validationenabled="true">
11+
<framework:validationenabled="true"email-validation-mode="html5">
1212
<framework:static-method>loadFoo</framework:static-method>
1313
<framework:static-method>loadBar</framework:static-method>
1414
</framework:validation>

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/validation_no_static_method.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88

99
<framework:configsecret="s3cr3t"http-method-override="false">
1010
<framework:annotationsenabled="false" />
11-
<framework:validationenabled="true"static-method="false" />
11+
<framework:validationenabled="true"email-validation-mode="html5"static-method="false" />
1212
</framework:config>
1313
</container>

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/validation_translation_domain.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77

88
<framework:confighttp-method-override="false">
99
<framework:annotationsenabled="false" />
10-
<framework:validationtranslation-domain="messages" />
10+
<framework:validationemail-validation-mode="html5"translation-domain="messages" />
1111
</framework:config>
1212
</container>

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ framework:
4545
paths:['%kernel.project_dir%/Fixtures/translations']
4646
validation:
4747
enabled:true
48+
email_validation_mode:html5
4849
annotations:false
4950
serializer:
5051
enabled:true

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/validation_annotations.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ framework:
55
validation:
66
enabled:true
77
enable_annotations:true
8+
email_validation_mode:html5
89

910
services:
1011
validator.alias:

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/validation_auto_mapping.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ framework:
33
http_method_override:false
44
property_info:{ enabled: true }
55
validation:
6+
email_validation_mode:html5
67
auto_mapping:
78
'App\':['foo', 'bar']
89
'Symfony\':['a', 'b']

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/validation_legacy_annotations.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ framework:
66
validation:
77
enabled:true
88
enable_annotations:true
9+
email_validation_mode:html5
910

1011
services:
1112
validator.alias:

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/validation_mapping.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ framework:
22
annotations:false
33
http_method_override:false
44
validation:
5+
email_validation_mode:html5
56
mapping:
67
paths:
78
-"%kernel.project_dir%/Fixtures/TestBundle/Resources/config/validation_mapping/files"

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/validation_multiple_static_methods.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ framework:
44
secret:s3cr3t
55
validation:
66
enabled:true
7+
email_validation_mode:html5
78
static_method:[loadFoo, loadBar]

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/validation_no_static_method.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ framework:
44
secret:s3cr3t
55
validation:
66
enabled:true
7+
email_validation_mode:html5
78
static_method:false

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/validation_translation_domain.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ framework:
22
annotations:false
33
http_method_override:false
44
validation:
5+
email_validation_mode:html5
56
translation_domain:messages

‎src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Uid/config_enabled.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ imports:
33

44
framework:
55
http_method_override:false
6-
uid:~
6+
uid:
7+
default_uuid_version:7
8+
time_based_uuid_version:7

‎src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/config/framework.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ framework:
33
http_method_override:false
44
secret:test
55
router:{ resource: "%kernel.project_dir%/%kernel.test_case%/routing.yml", utf8: true }
6-
validation:{ enabled: true, enable_annotations: true }
6+
validation:{ enabled: true, enable_annotations: true, email_validation_mode: html5 }
77
csrf_protection:true
88
form:
99
enabled:true

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp