Skip to content

Commit 9bfbe52

Browse files
Merge branch '6.1' into 6.2
* 6.1: [HttpFoundation] IPv4-mapped IPv6 addresses incorrectly rejected Minor (comment only), part 2 [RateLimiter] Add typecast to Reservation::wait [FrameworkBundle] add `kernel.locale_aware` tag to `LocaleSwitcher` [FrameworkBundle] Remove check of undefined service in mailer assertions [VarDumper] Ignore \Error in __debugInfo()
2 parents 1e7544c + 356c0d6 commit 9bfbe52

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Caster/Caster.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static function castObject(object $obj, string $class, bool $hasDebugInfo
4747
if ($hasDebugInfo) {
4848
try {
4949
$debugInfo = $obj->__debugInfo();
50-
} catch (\Exception) {
50+
} catch (\Throwable) {
5151
// ignore failing __debugInfo()
5252
$hasDebugInfo = false;
5353
}

Tests/Caster/CasterTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,4 +175,14 @@ public function testAnonymousClass()
175175
, $c
176176
);
177177
}
178+
179+
public function testTypeErrorInDebugInfo()
180+
{
181+
$this->assertDumpMatchesFormat('class@anonymous {}', new class() {
182+
public function __debugInfo(): array
183+
{
184+
return ['class' => \get_class(null)];
185+
}
186+
});
187+
}
178188
}

0 commit comments

Comments
 (0)