8000 Merge branch '2.8' into 3.2 · symfony/symfony@5676526 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5676526

Browse files
Merge branch '2.8' into 3.2
* 2.8: [VarDumper] ExceptionCaster robustness fix
2 parents 7062e74 + 9fb17b4 commit 5676526

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/Symfony/Component/Form/Tests/Extension/Core/Type/ChoiceTypeTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1372,7 +1372,6 @@ public function testSubmitMultipleChoicesInts()
13721372
$form = $this->factory->create(static::TESTED_TYPE, null, array(
13731373
'multiple' => true,
13741374
'choices' => array_flip($this->numericChoicesFlipped),
1375-
'choices_as_values' => true,
13761375
));
13771376

13781377
$form->submit(array(1, 2));

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,9 @@ public static function castThrowingCasterException(ThrowingCasterException $e, a
6767
$prefix = Caster::PREFIX_PROTECTED;
6868
$xPrefix = "\0Exception\0";
6969

70-
if (isset($a[$xPrefix.'previous'], $a[$xPrefix.'trace'])) {
70+
if (isset($a[$xPrefix.'previous'], $a[$xPrefix.'trace']) && $a[$xPrefix.'previous'] instanceof \Exception) {
7171
$b = (array) $a[$xPrefix.'previous'];
72-
if (isset($a[$prefix.'file'], $a[$prefix.'line'])) {
73-
self::traceUnshift($b[$xPrefix.'trace'], get_class($a[$xPrefix.'previous']), $b[$prefix.'file'], $b[$prefix.'line']);
74-
}
72+
self::traceUnshift($b[$xPrefix.'trace'], get_class($a[$xPrefix.'previous']), $b[$prefix.'file'], $b[$prefix.'line']);
7573
$a[$xPrefix.'trace'] = new TraceStub($b[$xPrefix.'trace'], false, 0, -1 - count($a[$xPrefix.'trace']->value));
7674
}
7775

0 commit comments

Comments
 (0)
0