8000 [VarDumper] fix array key error for class SymfonyCaster by zcodes · Pull Request #33919 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[VarDumper] fix array key error for class SymfonyCaster #33919

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 9, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/Symfony/Component/VarDumper/Caster/SymfonyCaster.php
66B9
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ public static function castRequest(Request $request, array $a, Stub $stub, $isNe
$clone = null;

foreach (self::$requestGetters as $prop => $getter) {
if (null === $a[Caster::PREFIX_PROTECTED.$prop]) {
$key = Caster::PREFIX_PROTECTED.$prop;
if (\array_key_exists($key, $a) && null === $a[$key]) {
if (null === $clone) {
$clone = clone $request;
}
Expand All @@ -44,7 +45,9 @@ public static function castRequest(Request $request, array $a, Stub $stub, $isNe
public static function castHttpClient($client, array $a, Stub $stub, $isNested)
{
$multiKey = sprintf("\0%s\0multi", \get_class($client));
$a[$multiKey] = new CutStub($a[$multiKey]);
if (isset($a[$multiKey])) {
$a[$multiKey] = new CutStub($a[$multiKey]);
}

return $a;
}
Expand Down
0