File tree Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Expand file tree Collapse file tree 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)
6060 $ class = new \ReflectionClass ($ class );
6161
6262 // 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+ }
6668 }
67- }
69+ } while ( $ class = $ class -> getParentClass ());
6870
6971 return false ;
7072 }
Original file line number Diff line number Diff line change @@ -441,6 +441,11 @@ public function testMaxDepth()
441441
442442 $ this ->assertEquals ($ expected , $ result );
443443 }
444+
445+ public function testInheritedPropertiesSupport ()
446+ {
447+ $ this ->assertTrue ($ this ->normalizer ->supportsNormalization (new PropertyChildDummy ()));
448+ }
444449}
445450
446451class PropertyDummy
@@ -509,3 +514,12 @@ class StaticPropertyDummy
509514{
510515 private static $ property = 'value ' ;
511516}
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