File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 1616 /** @param \Iterator<int, Type> $iterator */
1717 public function __construct (
1818 private string $ reason ,
19- private \Throwable $ exception ,
19+ private ? \Throwable $ exception ,
2020 private \Iterator $ iterator ,
2121 ) {}
2222
@@ -27,6 +27,9 @@ public function reasons(): ?array
2727
2828 public function exceptions (): ?array
2929 {
30+ if ($ this ->exception === null ) {
31+ return null ;
32+ }
3033 return [$ this ->exception ];
3134 }
3235
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ final class RejectionResultBucket implements Contract\RejectionResultBucketInter
1919 /** @param Type ...$values */
2020 public function __construct (
2121 private readonly string $ reason ,
22- private readonly \Throwable $ exception ,
22+ private readonly ? \Throwable $ exception ,
2323 ...$ values ,
2424 ) {
2525 $ this ->values = array_values ($ values );
@@ -32,6 +32,10 @@ public function reasons(): ?array
3232
3333 public function exceptions (): ?array
3434 {
35+ if ($ this ->exception === null ) {
36+ return null ;
37+ }
38+
3539 return [$ this ->exception ];
3640 }
3741
You can’t perform that action at this time.
0 commit comments