File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 1010
1111use function array_map ;
1212use function array_merge ;
13+ use function array_values ;
1314
1415final class AmpExceptionUnwrapper implements ExceptionUnwrapper
1516{
@@ -25,9 +26,11 @@ public function unwrap(Throwable $exception): array
2526 return $ this ->innerUnwrapper ->unwrap ($ exception );
2627 }
2728
29+ $ wrappedExceptions = array_values ($ exception ->getReasons ());
30+
2831 $ unwrapped = array_map (
2932 $ this ->outerUnwrapper ->unwrap (...),
30- $ exception -> getReasons () ,
33+ $ wrappedExceptions ,
3134 );
3235
3336 return array_merge (...$ unwrapped );
Original file line number Diff line number Diff line change 1010
1111use function array_map ;
1212use function array_merge ;
13+ use function array_values ;
1314
1415final class MessengerExceptionUnwrapper implements ExceptionUnwrapper
1516{
@@ -25,8 +26,8 @@ public function unwrap(Throwable $exception): array
2526 return $ this ->innerUnwrapper ->unwrap ($ exception );
2627 }
2728
28- /** @var non-empty-array <Throwable> $wrappedExceptions */
29- $ wrappedExceptions = $ exception ->getWrappedExceptions ();
29+ /** @var non-empty-list <Throwable> $wrappedExceptions */
30+ $ wrappedExceptions = array_values ( $ exception ->getWrappedExceptions () );
3031
3132 $ unwrappedExceptions = array_map (
3233 $ this ->outerUnwrapper ->unwrap (...),
Original file line number Diff line number Diff line change @@ -75,9 +75,9 @@ public function testCompositeExceptionIsUnwrapped(): void
7575 new HandlerFailedException (
7676 Envelope::wrap (new stdClass ()),
7777 [
78- $ exception1 ,
78+ ' first ' => $ exception1 ,
7979 new CompositeException ([
80- $ exception2 ,
80+ ' second ' => $ exception2 ,
8181 ]),
8282 ],
8383 ),
You can’t perform that action at this time.
0 commit comments