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 10
10
11
11
use function array_map ;
12
12
use function array_merge ;
13
+ use function array_values ;
13
14
14
15
final class AmpExceptionUnwrapper implements ExceptionUnwrapper
15
16
{
@@ -25,9 +26,11 @@ public function unwrap(Throwable $exception): array
25
26
return $ this ->innerUnwrapper ->unwrap ($ exception );
26
27
}
27
28
29
+ $ wrappedExceptions = array_values ($ exception ->getReasons ());
30
+
28
31
$ unwrapped = array_map (
29
32
$ this ->outerUnwrapper ->unwrap (...),
30
- $ exception -> getReasons () ,
33
+ $ wrappedExceptions ,
31
34
);
32
35
33
36
return array_merge (...$ unwrapped );
Original file line number Diff line number Diff line change 10
10
11
11
use function array_map ;
12
12
use function array_merge ;
13
+ use function array_values ;
13
14
14
15
final class MessengerExceptionUnwrapper implements ExceptionUnwrapper
15
16
{
@@ -25,8 +26,8 @@ public function unwrap(Throwable $exception): array
25
26
return $ this ->innerUnwrapper ->unwrap ($ exception );
26
27
}
27
28
28
- /** @var non-empty-array <Throwable> $wrappedExceptions */
29
- $ wrappedExceptions = $ exception ->getWrappedExceptions ();
29
+ /** @var non-empty-list <Throwable> $wrappedExceptions */
30
+ $ wrappedExceptions = array_values ( $ exception ->getWrappedExceptions () );
30
31
31
32
$ unwrappedExceptions = array_map (
32
33
$ this ->outerUnwrapper ->unwrap (...),
Original file line number Diff line number Diff line change @@ -75,9 +75,9 @@ public function testCompositeExceptionIsUnwrapped(): void
75
75
new HandlerFailedException (
76
76
Envelope::wrap (new stdClass ()),
77
77
[
78
- $ exception1 ,
78
+ ' first ' => $ exception1 ,
79
79
new CompositeException ([
80
- $ exception2 ,
80
+ ' second ' => $ exception2 ,
81
81
]),
82
82
],
83
83
),
You can’t perform that action at this time.
0 commit comments