[VarDumper] fix array key error for class SymfonyCaster

This commit is contained in:
zcodes 2019-10-09 10:12:52 +08:00 committed by Nicolas Grekas
parent 0d4914149d
commit 1f20f35f74

View File

@ -30,7 +30,8 @@ class SymfonyCaster
$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;
}
@ -44,7 +45,9 @@ class SymfonyCaster
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;
}