@@ -1216,15 +1216,34 @@ public static function provideDenormalizeWithFilterBoolData(): array
1216
1216
{
1217
1217
return [
1218
1218
[['foo ' => 'true ' ], true ],
1219
+ [['foo ' => 'True ' ], true ],
1220
+ [['foo ' => 'TRUE ' ], true ],
1219
1221
[['foo ' => '1 ' ], true ],
1222
+ [['foo ' => 1 ], true ],
1220
1223
[['foo ' => 'yes ' ], true ],
1224
+ [['foo ' => 'Yes ' ], true ],
1225
+ [['foo ' => 'YES ' ], true ],
1226
+ [['foo ' => 'on ' ], true ],
1227
+ [['foo ' => 'On ' ], true ],
1228
+ [['foo ' => 'ON ' ], true ],
1221
1229
[['foo ' => 'false ' ], false ],
1230
+ [['foo ' => 'False ' ], false ],
1231
+ [['foo ' => 'FALSE ' ], false ],
1222
1232
[['foo ' => '0 ' ], false ],
1233
+ [['foo ' => 0 ], false ],
1223
1234
[['foo ' => 'no ' ], false ],
1235
+ [['foo ' => 'No ' ], false ],
1236
+ [['foo ' => 'NO ' ], false ],
1237
+ [['foo ' => 'off ' ], false ],
1238
+ [['foo ' => 'Off ' ], false ],
1239
+ [['foo ' => 'OFF ' ], false ],
1224
1240
[['foo ' => '' ], false ],
1225
1241
[['foo ' => null ], null ],
1226
1242
[['foo ' => 'null ' ], null ],
1227
1243
[['foo ' => 'something ' ], null ],
1244
+ [['foo ' => 'foo ' ], null ],
1245
+ [['foo ' => 1234567890 ], null ],
1246
+ [['foo ' => -1234567890 ], null ],
1228
1247
];
1229
1248
}
1230
1249
@@ -1253,10 +1272,7 @@ protected function isAllowedAttribute($classOrObject, string $attribute, ?string
1253
1272
1254
1273
public function testTemplateTypeWhenAnObjectIsPassedToDenormalize ()
1255
1274
{
1256
- $ normalizer = new class (
1257
- classMetadataFactory: new ClassMetadataFactory (new AttributeLoader ()),
1258
- propertyTypeExtractor: new PropertyInfoExtractor (typeExtractors: [new PhpStanExtractor (), new ReflectionExtractor ()])
1259
- ) extends AbstractObjectNormalizerDummy {
1275
+ $ normalizer = new class (classMetadataFactory: new ClassMetadataFactory (new AttributeLoader ()), propertyTypeExtractor: new PropertyInfoExtractor (typeExtractors: [new PhpStanExtractor (), new ReflectionExtractor ()])) extends AbstractObjectNormalizerDummy {
1260
1276
protected function isAllowedAttribute ($ classOrObject , string $ attribute , ?string $ format = null , array $ context = []): bool
1261
1277
{
1262
1278
return true ;
@@ -1279,10 +1295,7 @@ public function testDenormalizeTemplateType()
1279
1295
$ this ->markTestSkipped ('The PropertyInfo component before Symfony 7.1 does not support template types. ' );
1280
1296
}
1281
1297
1282
- $ normalizer = new class (
1283
- classMetadataFactory: new ClassMetadataFactory (new AttributeLoader ()),
1284
- propertyTypeExtractor: new PropertyInfoExtractor (typeExtractors: [new PhpStanExtractor (), new ReflectionExtractor ()])
1285
- ) extends AbstractObjectNormalizerDummy {
1298
+ $ normalizer = new class (classMetadataFactory: new ClassMetadataFactory (new AttributeLoader ()), propertyTypeExtractor: new PropertyInfoExtractor (typeExtractors: [new PhpStanExtractor (), new ReflectionExtractor ()])) extends AbstractObjectNormalizerDummy {
1286
1299
protected function isAllowedAttribute ($ classOrObject , string $ attribute , ?string $ format = null , array $ context = []): bool
1287
1300
{
1288
1301
return true ;
@@ -1587,7 +1600,7 @@ class TruePropertyDummy
1587
1600
1588
1601
class BoolPropertyDummy
1589
1602
{
1590
- /** @var null| bool */
1603
+ /** @var bool|null */
1591
1604
public $ foo ;
1592
1605
}
1593
1606
0 commit comments