Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 332d9e9

Browse filesBrowse 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
Copy full SHA for 332d9e9

File tree

1 file changed

+5
-2
lines changed
Filter options

1 file changed

+5
-2
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/VarDumper/Caster/SymfonyCaster.php
+5-2Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.