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

Commit4fa1d32

Browse files
committed
[Validator] Un-deprecate passing an annotation reader to AnnotationLoader
1 parentf354c1e commit4fa1d32

File tree

7 files changed

+5
-48
lines changed

7 files changed

+5
-48
lines changed

‎UPGRADE-6.4.md‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ Validator
157157
---------
158158

159159
* Deprecate Doctrine annotations support in favor of native attributes
160-
* Deprecate passing an annotation reader to the constructor signature of`AnnotationLoader`
161160
* Deprecate`ValidatorBuilder::setDoctrineAnnotationReader()`
162161
* Deprecate`ValidatorBuilder::addDefaultDoctrineAnnotationReader()`
163162
* Deprecate`ValidatorBuilder::enableAnnotationMapping()`, use`ValidatorBuilder::enableAttributeMapping()` instead

‎src/Symfony/Component/Validator/CHANGELOG.md‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ CHANGELOG
77
* Allow single integer for the`versions` option of the`Uuid` constraint
88
* Allow single constraint to be passed to the`constraints` option of the`When` constraint
99
* Deprecate Doctrine annotations support in favor of native attributes
10-
* Deprecate passing an annotation reader to the constructor signature of`AnnotationLoader`
1110
* Deprecate`ValidatorBuilder::setDoctrineAnnotationReader()`
1211
* Deprecate`ValidatorBuilder::addDefaultDoctrineAnnotationReader()`
1312
* Add`number`,`finite-number` and`finite-float` types to`Type` constraint

‎src/Symfony/Component/Validator/Mapping/Loader/AnnotationLoader.php‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ class AnnotationLoader implements LoaderInterface
3838

3939
publicfunction__construct(Reader$reader =null)
4040
{
41-
if ($reader) {
42-
trigger_deprecation('symfony/validator','6.4','Passing a "%s" instance as argument 1 to "%s()" is deprecated, pass null or omit the parameter instead.',get_debug_type($reader),__METHOD__);
43-
}
44-
4541
$this->reader =$reader;
4642
}
4743

‎src/Symfony/Component/Validator/Tests/Constraints/WhenTest.php‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ public function testNonConstraintsAreRejected()
5151
*/
5252
publicfunctiontestAnnotations()
5353
{
54-
$this->expectDeprecation('Since symfony/validator 6.4: Passing a "Doctrine\Common\Annotations\AnnotationReader" instance as argument 1 to "Symfony\Component\Validator\Mapping\Loader\AnnotationLoader::__construct()" is deprecated, pass null or omit the parameter instead.');
55-
5654
$loader =newAnnotationLoader(newAnnotationReader());
5755
$metadata =newClassMetadata(WhenTestWithAnnotations::class);
5856

‎src/Symfony/Component/Validator/Tests/Mapping/Loader/AnnotationLoaderWithHybridAnnotationsTest.php‎

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,58 +18,34 @@
1818
/**
1919
* @group legacy
2020
*/
21-
class AnnotationLoaderWithHybridAnnotationsTestextendsAnnotationLoaderTest
21+
class AnnotationLoaderWithHybridAnnotationsTestextendsAttributeLoaderTest
2222
{
2323
use ExpectDeprecationTrait;
2424

2525
publicfunctiontestLoadClassMetadataReturnsTrueIfSuccessful()
2626
{
27-
$this->expectDeprecation('Since symfony/validator 6.4: Passing a "Doctrine\Common\Annotations\AnnotationReader" instance as argument 1 to "Symfony\Component\Validator\Mapping\Loader\AnnotationLoader::__construct()" is deprecated, pass null or omit the parameter instead.');
2827
$this->expectDeprecation('Since symfony/validator 6.4: Class "Symfony\Component\Validator\Tests\Fixtures\Attribute\Entity" uses Doctrine Annotations to configure validation constraints, which is deprecated. Use PHP attributes instead.');
2928
$this->expectDeprecation('Since symfony/validator 6.4: Property "Symfony\Component\Validator\Tests\Fixtures\Attribute\Entity::$firstName" uses Doctrine Annotations to configure validation constraints, which is deprecated. Use PHP attributes instead.');
3029

3130
parent::testLoadClassMetadataReturnsTrueIfSuccessful();
3231
}
3332

34-
publicfunctiontestLoadClassMetadataReturnsFalseIfNotSuccessful()
35-
{
36-
$this->expectDeprecation('Since symfony/validator 6.4: Passing a "Doctrine\Common\Annotations\AnnotationReader" instance as argument 1 to "Symfony\Component\Validator\Mapping\Loader\AnnotationLoader::__construct()" is deprecated, pass null or omit the parameter instead.');
37-
38-
parent::testLoadClassMetadataReturnsFalseIfNotSuccessful();
39-
}
40-
4133
publicfunctiontestLoadClassMetadata()
4234
{
43-
$this->expectDeprecation('Since symfony/validator 6.4: Passing a "Doctrine\Common\Annotations\AnnotationReader" instance as argument 1 to "Symfony\Component\Validator\Mapping\Loader\AnnotationLoader::__construct()" is deprecated, pass null or omit the parameter instead.');
4435
$this->expectDeprecation('Since symfony/validator 6.4: Class "Symfony\Component\Validator\Tests\Fixtures\Attribute\Entity" uses Doctrine Annotations to configure validation constraints, which is deprecated. Use PHP attributes instead.');
4536
$this->expectDeprecation('Since symfony/validator 6.4: Property "Symfony\Component\Validator\Tests\Fixtures\Attribute\Entity::$firstName" uses Doctrine Annotations to configure validation constraints, which is deprecated. Use PHP attributes instead.');
4637

4738
parent::testLoadClassMetadata();
4839
}
4940

50-
publicfunctiontestLoadParentClassMetadata()
51-
{
52-
$this->expectDeprecation('Since symfony/validator 6.4: Passing a "Doctrine\Common\Annotations\AnnotationReader" instance as argument 1 to "Symfony\Component\Validator\Mapping\Loader\AnnotationLoader::__construct()" is deprecated, pass null or omit the parameter instead.');
53-
54-
parent::testLoadParentClassMetadata();
55-
}
56-
5741
publicfunctiontestLoadClassMetadataAndMerge()
5842
{
59-
$this->expectDeprecation('Since symfony/validator 6.4: Passing a "Doctrine\Common\Annotations\AnnotationReader" instance as argument 1 to "Symfony\Component\Validator\Mapping\Loader\AnnotationLoader::__construct()" is deprecated, pass null or omit the parameter instead.');
6043
$this->expectDeprecation('Since symfony/validator 6.4: Class "Symfony\Component\Validator\Tests\Fixtures\Attribute\Entity" uses Doctrine Annotations to configure validation constraints, which is deprecated. Use PHP attributes instead.');
6144
$this->expectDeprecation('Since symfony/validator 6.4: Property "Symfony\Component\Validator\Tests\Fixtures\Attribute\Entity::$firstName" uses Doctrine Annotations to configure validation constraints, which is deprecated. Use PHP attributes instead.');
6245

6346
parent::testLoadClassMetadataAndMerge();
6447
}
6548

66-
publicfunctiontestLoadGroupSequenceProviderAnnotation()
67-
{
68-
$this->expectDeprecation('Since symfony/validator 6.4: Passing a "Doctrine\Common\Annotations\AnnotationReader" instance as argument 1 to "Symfony\Component\Validator\Mapping\Loader\AnnotationLoader::__construct()" is deprecated, pass null or omit the parameter instead.');
69-
70-
parent::testLoadGroupSequenceProviderAnnotation();
71-
}
72-
7349
protectedfunctioncreateAnnotationLoader():AnnotationLoader
7450
{
7551
returnnewAnnotationLoader(newAnnotationReader());

‎src/Symfony/Component/Validator/Tests/Mapping/Loader/AnnotationLoaderWithLegacyAnnotationsTest.php‎

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,12 @@
1818
/**
1919
* @group legacy
2020
*/
21-
class AnnotationLoaderWithLegacyAnnotationsTestextendsAnnotationLoaderTest
21+
class AnnotationLoaderWithLegacyAnnotationsTestextendsAttributeLoaderTest
2222
{
2323
use ExpectDeprecationTrait;
2424

2525
publicfunctiontestLoadClassMetadataReturnsTrueIfSuccessful()
2626
{
27-
$this->expectDeprecation('Since symfony/validator 6.4: Passing a "Doctrine\Common\Annotations\AnnotationReader" instance as argument 1 to "Symfony\Component\Validator\Mapping\Loader\AnnotationLoader::__construct()" is deprecated, pass null or omit the parameter instead.');
2827
$this->expectDeprecation('Since symfony/validator 6.4: Class "Symfony\Component\Validator\Tests\Fixtures\Annotation\Entity" uses Doctrine Annotations to configure validation constraints, which is deprecated. Use PHP attributes instead.');
2928
$this->expectDeprecation('Since symfony/validator 6.4: Property "Symfony\Component\Validator\Tests\Fixtures\Annotation\Entity::$firstName" uses Doctrine Annotations to configure validation constraints, which is deprecated. Use PHP attributes instead.');
3029
$this->expectDeprecation('Since symfony/validator 6.4: Property "Symfony\Component\Validator\Tests\Fixtures\Annotation\Entity::$childA" uses Doctrine Annotations to configure validation constraints, which is deprecated. Use PHP attributes instead.');
@@ -38,16 +37,8 @@ public function testLoadClassMetadataReturnsTrueIfSuccessful()
3837
parent::testLoadClassMetadataReturnsTrueIfSuccessful();
3938
}
4039

41-
publicfunctiontestLoadClassMetadataReturnsFalseIfNotSuccessful()
42-
{
43-
$this->expectDeprecation('Since symfony/validator 6.4: Passing a "Doctrine\Common\Annotations\AnnotationReader" instance as argument 1 to "Symfony\Component\Validator\Mapping\Loader\AnnotationLoader::__construct()" is deprecated, pass null or omit the parameter instead.');
44-
45-
parent::testLoadClassMetadataReturnsFalseIfNotSuccessful();
46-
}
47-
4840
publicfunctiontestLoadClassMetadata()
4941
{
50-
$this->expectDeprecation('Since symfony/validator 6.4: Passing a "Doctrine\Common\Annotations\AnnotationReader" instance as argument 1 to "Symfony\Component\Validator\Mapping\Loader\AnnotationLoader::__construct()" is deprecated, pass null or omit the parameter instead.');
5142
$this->expectDeprecation('Since symfony/validator 6.4: Class "Symfony\Component\Validator\Tests\Fixtures\Annotation\Entity" uses Doctrine Annotations to configure validation constraints, which is deprecated. Use PHP attributes instead.');
5243
$this->expectDeprecation('Since symfony/validator 6.4: Property "Symfony\Component\Validator\Tests\Fixtures\Annotation\Entity::$firstName" uses Doctrine Annotations to configure validation constraints, which is deprecated. Use PHP attributes instead.');
5344
$this->expectDeprecation('Since symfony/validator 6.4: Property "Symfony\Component\Validator\Tests\Fixtures\Annotation\Entity::$childA" uses Doctrine Annotations to configure validation constraints, which is deprecated. Use PHP attributes instead.');
@@ -63,15 +54,13 @@ public function testLoadClassMetadata()
6354

6455
publicfunctiontestLoadParentClassMetadata()
6556
{
66-
$this->expectDeprecation('Since symfony/validator 6.4: Passing a "Doctrine\Common\Annotations\AnnotationReader" instance as argument 1 to "Symfony\Component\Validator\Mapping\Loader\AnnotationLoader::__construct()" is deprecated, pass null or omit the parameter instead.');
6757
$this->expectDeprecation('Since symfony/validator 6.4: Property "Symfony\Component\Validator\Tests\Fixtures\Annotation\EntityParent::$other" uses Doctrine Annotations to configure validation constraints, which is deprecated. Use PHP attributes instead.');
6858

6959
parent::testLoadParentClassMetadata();
7060
}
7161

7262
publicfunctiontestLoadClassMetadataAndMerge()
7363
{
74-
$this->expectDeprecation('Since symfony/validator 6.4: Passing a "Doctrine\Common\Annotations\AnnotationReader" instance as argument 1 to "Symfony\Component\Validator\Mapping\Loader\AnnotationLoader::__construct()" is deprecated, pass null or omit the parameter instead.');
7564
$this->expectDeprecation('Since symfony/validator 6.4: Property "Symfony\Component\Validator\Tests\Fixtures\Annotation\EntityParent::$other" uses Doctrine Annotations to configure validation constraints, which is deprecated. Use PHP attributes instead.');
7665
$this->expectDeprecation('Since symfony/validator 6.4: Class "Symfony\Component\Validator\Tests\Fixtures\Annotation\Entity" uses Doctrine Annotations to configure validation constraints, which is deprecated. Use PHP attributes instead.');
7766
$this->expectDeprecation('Since symfony/validator 6.4: Property "Symfony\Component\Validator\Tests\Fixtures\Annotation\Entity::$firstName" uses Doctrine Annotations to configure validation constraints, which is deprecated. Use PHP attributes instead.');
@@ -88,7 +77,6 @@ public function testLoadClassMetadataAndMerge()
8877

8978
publicfunctiontestLoadGroupSequenceProviderAnnotation()
9079
{
91-
$this->expectDeprecation('Since symfony/validator 6.4: Passing a "Doctrine\Common\Annotations\AnnotationReader" instance as argument 1 to "Symfony\Component\Validator\Mapping\Loader\AnnotationLoader::__construct()" is deprecated, pass null or omit the parameter instead.');
9280
$this->expectDeprecation('Since symfony/validator 6.4: Class "Symfony\Component\Validator\Tests\Fixtures\Annotation\GroupSequenceProviderEntity" uses Doctrine Annotations to configure validation constraints, which is deprecated. Use PHP attributes instead.');
9381

9482
parent::testLoadGroupSequenceProviderAnnotation();

‎src/Symfony/Component/Validator/Tests/Mapping/Loader/AnnotationLoaderTest.php‎renamed to ‎src/Symfony/Component/Validator/Tests/Mapping/Loader/AttributeLoaderTest.php‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@
3030
useSymfony\Component\Validator\Constraints\Valid;
3131
useSymfony\Component\Validator\Mapping\ClassMetadata;
3232
useSymfony\Component\Validator\Mapping\Loader\AnnotationLoader;
33+
useSymfony\Component\Validator\Mapping\Loader\AttributeLoader;
3334
useSymfony\Component\Validator\Tests\Fixtures\ConstraintA;
3435

35-
classAnnotationLoaderTestextends TestCase
36+
classAttributeLoaderTestextends TestCase
3637
{
3738
publicfunctiontestLoadClassMetadataReturnsTrueIfSuccessful()
3839
{
@@ -212,7 +213,7 @@ public function testLoadGroupSequenceProviderAnnotation()
212213

213214
protectedfunctioncreateAnnotationLoader():AnnotationLoader
214215
{
215-
returnnewAnnotationLoader();
216+
returnnewAttributeLoader();
216217
}
217218

218219
protectedfunctiongetFixtureNamespace():string

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp