8000 bug #33919 [VarDumper] fix array key error for class SymfonyCaster (z… · symfony/symfony@332d9e9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 332d9e9

Browse files
bug #33919 [VarDumper] fix array key error for class SymfonyCaster (zcodes)
This PR was squashed before being merged into the 4.3 branch (closes #33919). Discussion ---------- [VarDumper] fix array key error for class SymfonyCaster | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #33751 | License | MIT | Doc PR | - Commits ------- 1f20f35 [VarDumper] fix array key error for class SymfonyCaster
2 parents 0d49141 + 1f20f35 commit 332d9e9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Symfony/Component/VarDumper/Caster/SymfonyCaster.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ public static function castRequest(Request $request, array $a, Stub $stub, $isNe
3030
$clone = null;
3131

3232
foreach (self::$requestGetters as $prop => $getter) {
33-
if (null === $a[Caster::PREFIX_PROTECTED.$prop]) {
33+
$key = Caster::PREFIX_PROTECTED.$prop;
34+
if (\array_key_exists($key, $a) && null === $a[$key]) {
3435
if (null === $clone) {
3536
$clone = clone $request;
3637
}
@@ -44,7 +45,9 @@ public static function castRequest(Request $request, array $a, Stub $stub, $isNe
4445
public static function castHttpClient($client, array $a, Stub $stub, $isNested)
4546
{
4647
$multiKey = sprintf("\0%s\0multi", \get_class($client));
47-
$a[$multiKey] = new CutStub($a[$multiKey]);
48+
if (isset($a[$multiKey])) {
49+
$a[$multiKey] = new CutStub($a[$multiKey]);
50+
}
4851

4952
return $a;
5053
}

0 commit comments

Comments
 (0)
0