@@ -1216,15 +1216,34 @@ public static function provideDenormalizeWithFilterBoolData(): array
12161216 {
12171217 return [
12181218 [['foo ' => 'true ' ], true ],
1219+ [['foo ' => 'True ' ], true ],
1220+ [['foo ' => 'TRUE ' ], true ],
12191221 [['foo ' => '1 ' ], true ],
1222+ [['foo ' => 1 ], true ],
12201223 [['foo ' => 'yes ' ], true ],
1224+ [['foo ' => 'Yes ' ], true ],
1225+ [['foo ' => 'YES ' ], true ],
1226+ [['foo ' => 'on ' ], true ],
1227+ [['foo ' => 'On ' ], true ],
1228+ [['foo ' => 'ON ' ], true ],
12211229 [['foo ' => 'false ' ], false ],
1230+ [['foo ' => 'False ' ], false ],
1231+ [['foo ' => 'FALSE ' ], false ],
12221232 [['foo ' => '0 ' ], false ],
1233+ [['foo ' => 0 ], false ],
12231234 [['foo ' => 'no ' ], false ],
1235+ [['foo ' => 'No ' ], false ],
1236+ [['foo ' => 'NO ' ], false ],
1237+ [['foo ' => 'off ' ], false ],
1238+ [['foo ' => 'Off ' ], false ],
1239+ [['foo ' => 'OFF ' ], false ],
12241240 [['foo ' => '' ], false ],
12251241 [['foo ' => null ], null ],
12261242 [['foo ' => 'null ' ], null ],
12271243 [['foo ' => 'something ' ], null ],
1244+ [['foo ' => 'foo ' ], null ],
1245+ [['foo ' => 1234567890 ], null ],
1246+ [['foo ' => -1234567890 ], null ],
12281247 ];
12291248 }
12301249
@@ -1253,10 +1272,7 @@ protected function isAllowedAttribute($classOrObject, string $attribute, ?string
12531272
12541273 public function testTemplateTypeWhenAnObjectIsPassedToDenormalize ()
12551274 {
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 {
12601276 protected function isAllowedAttribute ($ classOrObject , string $ attribute , ?string $ format = null , array $ context = []): bool
12611277 {
12621278 return true ;
@@ -1279,10 +1295,7 @@ public function testDenormalizeTemplateType()
12791295 $ this ->markTestSkipped ('The PropertyInfo component before Symfony 7.1 does not support template types. ' );
12801296 }
12811297
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 {
12861299 protected function isAllowedAttribute ($ classOrObject , string $ attribute , ?string $ format = null , array $ context = []): bool
12871300 {
12881301 return true ;
@@ -1587,7 +1600,7 @@ class TruePropertyDummy
15871600
15881601class BoolPropertyDummy
15891602{
1590- /** @var null| bool */
1603+ /** @var bool|null */
15911604 public $ foo ;
15921605}
15931606
0 commit comments