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

Commitb0b86b1

Browse files
committed
require PropertyInfo 8.0+ in the Doctrine bridge
1 parent5fad6de commitb0b86b1

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

‎src/Symfony/Bridge/Doctrine/composer.json‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"symfony/lock":"^7.4|^8.0",
4141
"symfony/messenger":"^7.4|^8.0",
4242
"symfony/property-access":"^7.4|^8.0",
43-
"symfony/property-info":"^7.4|^8.0",
43+
"symfony/property-info":"^8.0",
4444
"symfony/security-core":"^7.4|^8.0",
4545
"symfony/stopwatch":"^7.4|^8.0",
4646
"symfony/translation":"^7.4|^8.0",
@@ -53,7 +53,8 @@
5353
"doctrine/collections":"<1.8",
5454
"doctrine/dbal":"<3.6",
5555
"doctrine/lexer":"<1.1",
56-
"doctrine/orm":"<2.15"
56+
"doctrine/orm":"<2.15",
57+
"symfony/property-info":"<8.0"
5758
},
5859
"autoload": {
5960
"psr-4": {"Symfony\\Bridge\\Doctrine\\":"" },

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

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
useSymfony\Component\PropertyInfo\PropertyAccessExtractorInterface;
1616
useSymfony\Component\PropertyInfo\PropertyListExtractorInterface;
1717
useSymfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
18+
useSymfony\Component\PropertyInfo\TypeasLegacyType;
1819
useSymfony\Component\TypeInfo\Type;
1920
useSymfony\Component\Validator\Constraints\All;
2021
useSymfony\Component\Validator\Constraints\Iban;
@@ -61,6 +62,7 @@ public function testLoadClassMetadata()
6162
privateint$i =0;
6263
privateint$j =0;
6364
privatearray$types;
65+
privatearray$legacyTypes;
6466

6567
publicfunctiongetType(string$class,string$property,array$context = []): ?Type
6668
{
@@ -84,6 +86,29 @@ public function getType(string $class, string $property, array $context = []): ?
8486

8587
return$type;
8688
}
89+
90+
publicfunctiongetTypes(string$class,string$property,array$context = []): ?array
91+
{
92+
$this->legacyTypes ??= [
93+
[newLegacyType('string',true)],
94+
[newLegacyType('string')],
95+
[newLegacyType('string',true),newLegacyType('int'),newLegacyType('bool')],
96+
[newLegacyType('object',true, Entity::class)],
97+
[newLegacyType('array',true,null,true,null,newLegacyType('object',false, Entity::class))],
98+
[newLegacyType('array',true,null,true)],
99+
[newLegacyType('float',true)],// The existing constraint is float
100+
[newLegacyType('string',true)],
101+
[newLegacyType('string',true)],
102+
[newLegacyType('array',true,null,true,null,newLegacyType('float'))],
103+
[newLegacyType('string')],
104+
[newLegacyType('string')],
105+
];
106+
107+
$legacyType =$this->legacyTypes[$this->j];
108+
++$this->j;
109+
110+
return$legacyType;
111+
}
87112
};
88113

89114
$propertyAccessExtractor =$this->createMock(PropertyAccessExtractorInterface::class);
@@ -215,6 +240,11 @@ public function getType(string $class, string $property, array $context = []): ?
215240
{
216241
return Type::string();
217242
}
243+
244+
publicfunctiongetTypes(string$class,string$property,array$context = []): ?array
245+
{
246+
return [newLegacyType('string')];
247+
}
218248
};
219249

220250
$propertyAccessExtractor =$this->createMock(PropertyAccessExtractorInterface::class);
@@ -249,6 +279,11 @@ public function getType(string $class, string $property, array $context = []): ?
249279
{
250280
return Type::string();
251281
}
282+
283+
publicfunctiongetTypes(string$class,string$property,array$context = []): ?array
284+
{
285+
return [newLegacyType('string')];
286+
}
252287
};
253288
}
254289

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp