Skip to content

Commit d00e0aa

Browse files
[FrameworkBundle][Validator] Remove remaining deprecations
1 parent 52e98e2 commit d00e0aa

File tree

21 files changed

+108
-204
lines changed

21 files changed

+108
-204
lines changed

UPGRADE-7.0.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ FrameworkBundle
202202
* Remove the integration of Doctrine annotations, use native attributes instead
203203
* Remove `EnableLoggerDebugModePass`, use argument `$debug` of HttpKernel's `Logger` instead
204204
* Remove `AddDebugLogProcessorPass::configureLogger()`, use HttpKernel's `DebugLoggerConfigurator` instead
205+
* Remove the `framework.validation.enable_annotations` config option, use `framework.validation.enable_attributes` instead
206+
* Remove the `framework.serializer.enable_annotations` config option, use `framework.serializer.enable_attributes` instead
205207

206208
HttpFoundation
207209
--------------
@@ -467,6 +469,9 @@ Validator
467469
* Remove the annotation reader parameter from the constructor signature of `AnnotationLoader`
468470
* Remove `ValidatorBuilder::setDoctrineAnnotationReader()`
469471
* Remove `ValidatorBuilder::addDefaultDoctrineAnnotationReader()`
472+
* Remove `ValidatorBuilder::enableAnnotationMapping()`, use `ValidatorBuilder::enableAttributeMapping()` instead
473+
* Remove `ValidatorBuilder::disableAnnotationMapping()`, use `ValidatorBuilder::disableAttributeMapping()` instead
474+
* Remove `AnnotationLoader`, use `AttributeLoader` instead
470475

471476
VarDumper
472477
---------

src/Symfony/Bridge/Doctrine/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"symfony/stopwatch": "^6.4|^7.0",
4040
"symfony/translation": "^6.4|^7.0",
4141
"symfony/uid": "^6.4|^7.0",
42-
"symfony/validator": "^6.4|^7.0",
42+
"symfony/validator": "^7.0",
4343
"symfony/var-dumper": "^6.4|^7.0",
4444
"doctrine/collections": "^1.0|^2.0",
4545
"doctrine/data-fixtures": "^1.1",
@@ -61,7 +61,7 @@
6161
"symfony/property-info": "<6.4",
6262
"symfony/security-bundle": "<6.4",
6363
"symfony/security-core": "<6.4",
64-
"symfony/validator": "<6.4"
64+
"symfony/validator": "<7.0"
6565
},
6666
"autoload": {
6767
"psr-4": { "Symfony\\Bridge\\Doctrine\\": "" },

src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ CHANGELOG
1414
* Remove the integration of Doctrine annotations, use native attributes instead
1515
* Remove `EnableLoggerDebugModePass`, use argument `$debug` of HttpKernel's `Logger` instead
1616
* Remove `AddDebugLogProcessorPass::configureLogger()`, use HttpKernel's `DebugLoggerConfigurator` instead
17+
* Remove the `framework.validation.enable_annotations` config option, use `framework.validation.enable_attributes` instead
18+
* Remove the `framework.serializer.enable_annotations` config option, use `framework.serializer.enable_attributes` instead
1719

1820
6.4
1921
---

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

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,16 +1023,6 @@ private function addValidationSection(ArrayNodeDefinition $rootNode, callable $e
10231023
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.');
10241024
}
10251025

1026-
if (isset($v['enable_annotations'])) {
1027-
trigger_deprecation('symfony/framework-bundle', '6.4', 'Option "enable_annotations" at "framework.validation" is deprecated. Use the "enable_attributes" option instead.');
1028-
1029-
if (!isset($v['enable_attributes'])) {
1030-
$v['enable_attributes'] = $v['enable_annotations'];
1031-
} else {
1032-
throw new LogicException('The "enable_annotations" and "enable_attributes" options at path "framework.validation" must not be both set. Only the "enable_attributes" option must be used.');
1033-
}
1034-
}
1035-
10361026
return $v;
10371027
})
10381028
->end()
@@ -1042,7 +1032,6 @@ private function addValidationSection(ArrayNodeDefinition $rootNode, callable $e
10421032
->{$enableIfStandalone('symfony/validator', Validation::class)}()
10431033
->children()
10441034
->scalarNode('cache')->end()
1045-
->booleanNode('enable_annotations')->end()
10461035
->booleanNode('enable_attributes')->{!class_exists(FullStack::class) ? 'defaultTrue' : 'defaultFalse'}()->end()
10471036
->arrayNode('static_method')
10481037
->defaultValue(['loadValidatorMetadata'])
@@ -1143,24 +1132,9 @@ private function addSerializerSection(ArrayNodeDefinition $rootNode, callable $e
11431132
$rootNode
11441133
->children()
11451134
->arrayNode('serializer')
1146-
->validate()
1147-
->always(function ($v) {
1148-
if (isset($v['enable_annotations'])) {
1149-
trigger_deprecation('symfony/framework-bundle', '6.4', 'Option "enable_annotations" at "framework.serializer" is deprecated. Use the "enable_attributes" option instead.');
1150-
1151-
if (!isset($v['enable_attributes'])) {
1152-
$v['enable_attributes'] = $v['enable_annotations'];
1153-
} else {
1154-
throw new LogicException('The "enable_annotations" and "enable_attributes" options at path "framework.serializer" must not be both set. Only the "enable_attributes" option must be used.');
1155-
}
1156-
}
1157-
1158-
return $v;
1159-
})->end()
11601135
->info('serializer configuration')
11611136
->{$enableIfStandalone('symfony/serializer', Serializer::class)}()
11621137
->children()
1163-
->booleanNode('enable_annotations')->end()
11641138
->booleanNode('enable_attributes')->{!class_exists(FullStack::class) ? 'defaultTrue' : 'defaultFalse'}()->end()
11651139
->scalarNode('name_converter')->end()
11661140
->scalarNode('circular_reference_handler')->end()

src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@
266266

267267
<xsd:attribute name="enabled" type="xsd:boolean" />
268268
<xsd:attribute name="cache" type="xsd:string" />
269-
<xsd:attribute name="enable-annotations" type="xsd:boolean" />
270269
<xsd:attribute name="enable-attributes" type="xsd:boolean" />
271270
<xsd:attribute name="static-method" type="xsd:boolean" />
272271
<xsd:attribute name="translation-domain" type="xsd:string" />
@@ -320,7 +319,6 @@
320319
<xsd:element name="default-context" type="metadata" minOccurs="0" maxOccurs="1" />
321320
</xsd:choice>
322321
<xsd:attribute name="enabled" type="xsd:boolean" />
323-
<xsd:attribute name="enable-annotations" type="xsd:boolean" />
324322
<xsd:attribute name="enable-attributes" type="xsd:boolean" />
325323
<xsd:attribute name="name-converter" type="xsd:string" />
326324
<xsd:attribute name="circular-reference-handler" type="xsd:string" />

src/Symfony/Bundle/SecurityBundle/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"symfony/translation": "^6.4|^7.0",
4848
"symfony/twig-bundle": "^6.4|^7.0",
4949
"symfony/twig-bridge": "^6.4|^7.0",
50-
"symfony/validator": "^6.4|^7.0",
50+
"symfony/validator": "^7.0",
5151
"symfony/yaml": "^6.4|^7.0",
5252
"twig/twig": "^2.13|^3.0.4",
5353
"web-token/jwt-checker": "^3.1",

src/Symfony/Component/HttpKernel/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"symfony/translation-contracts": "^2.5|^3",
4444
"symfony/uid": "^6.4|^7.0",
4545
"symfony/validator": "^6.4|^7.0",
46-
"symfony/var-exporter": "^6.4|^7.0",
46+
"symfony/var-exporter": "^7.0",
4747
"psr/cache": "^1.0|^2.0|^3.0",
4848
"twig/twig": "^2.13|^3.0.4"
4949
},
@@ -65,7 +65,7 @@
6565
"symfony/translation": "<6.4",
6666
"symfony/translation-contracts": "<2.5",
6767
"symfony/twig-bridge": "<6.4",
68-
"symfony/validator": "<6.4",
68+
"symfony/validator": "<7.0",
6969
"symfony/var-dumper": "<6.4",
7070
"twig/twig": "<2.13"
7171
},

src/Symfony/Component/Security/Core/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@
3131
"symfony/ldap": "^6.4|^7.0",
3232
"symfony/string": "^6.4|^7.0",
3333
"symfony/translation": "^6.4|^7.0",
34-
"symfony/validator": "^6.4|^7.0",
34+
"symfony/validator": "^7.0",
3535
"psr/log": "^1|^2|^3"
3636
},
3737
"conflict": {
3838
"symfony/event-dispatcher": "<6.4",
3939
"symfony/http-foundation": "<6.4",
4040
"symfony/security-guard": "<6.4",
4141
"symfony/ldap": "<6.4",
42-
"symfony/validator": "<6.4"
42+
"symfony/validator": "<7.0"
4343
},
4444
"autoload": {
4545
"psr-4": { "Symfony\\Component\\Security\\Core\\": "" },

src/Symfony/Component/Validator/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ CHANGELOG
1515
* Remove the annotation reader parameter from the constructor signature of `AnnotationLoader`
1616
* Remove `ValidatorBuilder::setDoctrineAnnotationReader()`
1717
* Remove `ValidatorBuilder::addDefaultDoctrineAnnotationReader()`
18+
* Remove `ValidatorBuilder::enableAnnotationMapping()`, use `ValidatorBuilder::enableAttributeMapping()` instead
19+
* Remove `ValidatorBuilder::disableAnnotationMapping()`, use `ValidatorBuilder::disableAttributeMapping()` instead
20+
* Remove `AnnotationLoader`, use `AttributeLoader` instead
1821

1922
6.4
2023
---

src/Symfony/Component/Validator/Constraints/Callback.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Callback extends Constraint
2626

2727
public function __construct(array|string|callable $callback = null, array $groups = null, mixed $payload = null, array $options = [])
2828
{
29-
// Invocation through annotations with an array parameter only
29+
// Invocation through attributes with an array parameter only
3030
if (\is_array($callback) && 1 === \count($callback) && isset($callback['value'])) {
3131
$callback = $callback['value'];
3232
}

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