Skip to content

Commit 23a59f7

Browse files
[FrameworkBundle][Validator] Deprecate annotation occurrences
1 parent 1464c8b commit 23a59f7

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

Tests/Validator/Constraints/UniqueEntityTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
1616
use Symfony\Component\Validator\Mapping\ClassMetadata;
17-
use Symfony\Component\Validator\Mapping\Loader\AnnotationLoader;
17+
use Symfony\Component\Validator\Mapping\Loader\AttributeLoader;
1818

1919
class UniqueEntityTest extends TestCase
2020
{
2121
public function testAttributeWithDefaultProperty()
2222
{
2323
$metadata = new ClassMetadata(UniqueEntityDummyOne::class);
24-
$loader = new AnnotationLoader();
24+
$loader = new AttributeLoader();
2525
self::assertTrue($loader->loadClassMetadata($metadata));
2626

2727
/** @var UniqueEntity $constraint */
@@ -35,7 +35,7 @@ public function testAttributeWithDefaultProperty()
3535
public function testAttributeWithCustomizedService()
3636
{
3737
$metadata = new ClassMetadata(UniqueEntityDummyTwo::class);
38-
$loader = new AnnotationLoader();
38+
$loader = new AttributeLoader();
3939
self::assertTrue($loader->loadClassMetadata($metadata));
4040

4141
/** @var UniqueEntity $constraint */
@@ -50,7 +50,7 @@ public function testAttributeWithCustomizedService()
5050
public function testAttributeWithGroupsAndPaylod()
5151
{
5252
$metadata = new ClassMetadata(UniqueEntityDummyThree::class);
53-
$loader = new AnnotationLoader();
53+
$loader = new AttributeLoader();
5454
self::assertTrue($loader->loadClassMetadata($metadata));
5555

5656
/** @var UniqueEntity $constraint */

Tests/Validator/DoctrineLoaderTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class DoctrineLoaderTest extends TestCase
3939
public function testLoadClassMetadata()
4040
{
4141
$validator = Validation::createValidatorBuilder()
42-
->enableAnnotationMapping(true)
42+
->enableAttributeMapping()
4343
->addLoader(new DoctrineLoader(DoctrineTestHelper::createTestEntityManager(), '{^Symfony\\\\Bridge\\\\Doctrine\\\\Tests\\\\Fixtures\\\\DoctrineLoader}'))
4444
->getValidator()
4545
;
@@ -142,7 +142,7 @@ public function testExtractEnum()
142142
{
143143
$validator = Validation::createValidatorBuilder()
144144
->addMethodMapping('loadValidatorMetadata')
145-
->enableAnnotationMapping(true)
145+
->enableAttributeMapping()
146146
->addLoader(new DoctrineLoader(DoctrineTestHelper::createTestEntityManager(), '{^Symfony\\\\Bridge\\\\Doctrine\\\\Tests\\\\Fixtures\\\\DoctrineLoader}'))
147147
->getValidator()
148148
;
@@ -159,7 +159,7 @@ public function testExtractEnum()
159159
public function testFieldMappingsConfiguration()
160160
{
161161
$validator = Validation::createValidatorBuilder()
162-
->enableAnnotationMapping(true)
162+
->enableAttributeMapping()
163163
->addXmlMappings([__DIR__.'/../Resources/validator/BaseUser.xml'])
164164
->addLoader(
165165
new DoctrineLoader(
@@ -200,7 +200,7 @@ public static function regexpProvider(): array
200200
public function testClassNoAutoMapping()
201201
{
202202
$validator = Validation::createValidatorBuilder()
203-
->enableAnnotationMapping(true)
203+
->enableAttributeMapping()
204204
->addLoader(new DoctrineLoader(DoctrineTestHelper::createTestEntityManager(), '{.*}'))
205205
->getValidator();
206206

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"symfony/stopwatch": "^5.4|^6.0|^7.0",
4242
"symfony/translation": "^5.4|^6.0|^7.0",
4343
"symfony/uid": "^5.4|^6.0|^7.0",
44-
"symfony/validator": "^5.4.25|~6.2.12|^6.3.1|^7.0",
44+
"symfony/validator": "^6.4|^7.0",
4545
"symfony/var-dumper": "^5.4|^6.0|^7.0",
4646
"doctrine/collections": "^1.0|^2.0",
4747
"doctrine/data-fixtures": "^1.1",
@@ -63,7 +63,7 @@
6363
"symfony/property-info": "<5.4",
6464
"symfony/security-bundle": "<5.4",
6565
"symfony/security-core": "<6.4",
66-
"symfony/validator": "<5.4.25|>=6,<6.2.12|>=6.3,<6.3.1"
66+
"symfony/validator": "<6.4"
6767
},
6868
"autoload": {
6969
"psr-4": { "Symfony\\Bridge\\Doctrine\\": "" },

0 commit comments

Comments
 (0)