File tree 2 files changed +20
-4
lines changed
src/Symfony/Component/Serializer
2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -60,11 +60,13 @@ private function supports($class)
60
60
$ class = new \ReflectionClass ($ class );
61
61
62
62
// We look for at least one non-static property
63
- foreach ($ class ->getProperties () as $ property ) {
64
- if (!$ property ->isStatic ()) {
65
- return true ;
63
+ do {
64
+ foreach ($ class ->getProperties () as $ property ) {
65
+ if (!$ property ->isStatic ()) {
66
+ return true ;
67
+ }
66
68
}
67
- }
69
+ } while ( $ class = $ class -> getParentClass ());
68
70
69
71
return false ;
70
72
}
Original file line number Diff line number Diff line change @@ -441,6 +441,11 @@ public function testMaxDepth()
441
441
442
442
$ this ->assertEquals ($ expected , $ result );
443
443
}
444
+
445
+ public function testInheritedPropertiesSupport ()
446
+ {
447
+ $ this ->assertTrue ($ this ->normalizer ->supportsNormalization (new PropertyChildDummy ()));
448
+ }
444
449
}
445
450
446
451
class PropertyDummy
@@ -509,3 +514,12 @@ class StaticPropertyDummy
509
514
{
510
515
private static $ property = 'value ' ;
511
516
}
517
+
518
+ class PropertyParentDummy
519
+ {
520
+ private $ foo = 'bar ' ;
521
+ }
522
+
523
+ class PropertyChildDummy extends PropertyParentDummy
524
+ {
525
+ }
You can’t perform that action at this time.
0 commit comments