Skip to content

Commit e758122

Browse files
committed
Merge branch '6.4' into 7.0
* 6.4: (31 commits) [Messenger] Add call to `gc_collect_cycles()` after each message is handled fix tests fix tests on AppVeyor Hungarian typo fix in validators translation [VarDump] Fix order of dumped properties - parent goes first DX: drop unused import [Validator] updated Latvian translation re-introduce conflict rule with WebProfilerBundle < 6.4 [Validator] Added missing Swedish translations [Mailer] [Notifier] #52264 Update Sendinblue / Brevo API host [Validator] Added missing Estonian translations #51939 fix File constraint tests on 32bit PHP [Form] Skip merging params & files if there are no files in the first place [Translation] Ignore bridges in `.gitattributes` file [AssetMapper] Adding import-parsing case where import contains a path Add missing Hungarian validator translations Added missing Bosnian translations #51929 add return type hints to EntityFactory Update UndefinedCallableHandler with "importmap", "form" and "worflow" filters/functions [FrameworkBundle] Fix CommandDataCollector is always registered ...
2 parents e62cd00 + 44d76a0 commit e758122

File tree

2 files changed

+32
-4
lines changed

2 files changed

+32
-4
lines changed

Caster/Caster.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,10 @@ private static function getClassProperties(\ReflectionClass $class): array
177177
$classProperties = [];
178178
$className = $class->name;
179179

180+
if ($parent = $class->getParentClass()) {
181+
$classProperties += self::$classProperties[$parent->name] ??= self::getClassProperties($parent);
182+
}
183+
180184
foreach ($class->getProperties() as $p) {
181185
if ($p->isStatic()) {
182186
continue;
@@ -189,10 +193,6 @@ private static function getClassProperties(\ReflectionClass $class): array
189193
}] = new UninitializedStub($p);
190194
}
191195

192-
if ($parent = $class->getParentClass()) {
193-
$classProperties += self::$classProperties[$parent->name] ??= self::getClassProperties($parent);
194-
}
195-
196196
return $classProperties;
197197
}
198198
}

Tests/Caster/CasterTest.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,4 +185,32 @@ public function __debugInfo(): array
185185
}
186186
});
187187
}
188+
189+
public function testClassHierarchy()
190+
{
191+
$this->assertDumpMatchesFormat(<<<'DUMP'
192+
Symfony\Component\VarDumper\Tests\Caster\B {
193+
+a: "a"
194+
#b: "b"
195+
-c: "c"
196+
+d: "d"
197+
#e: "e"
198+
-f: "f"
199+
}
200+
DUMP, new B());
201+
}
202+
}
203+
204+
class A
205+
{
206+
public $a = 'a';
207+
protected $b = 'b';
208+
private $c = 'c';
209+
}
210+
211+
class B extends A
212+
{
213+
public $d = 'd';
214+
protected $e = 'e';
215+
private $f = 'f';
188216
}

0 commit comments

Comments
 (0)