File tree 3 files changed +5
-6
lines changed
3 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -70,9 +70,9 @@ private function buildExclusions(Exclusion ...$exclusions): array
70
70
new Node \Expr \Variable ('input ' ),
71
71
new Node \Expr \Yield_ (
72
72
new Node \Expr \New_ (
73
- $ exclusion ->reason ? new Node \Name \FullyQualified (RejectionWithReasonResultBucket::class) : new Node \Name \FullyQualified (RejectionResultBucket::class),
73
+ null !== $ exclusion ->reason ? new Node \Name \FullyQualified (RejectionWithReasonResultBucket::class) : new Node \Name \FullyQualified (RejectionResultBucket::class),
74
74
[
75
- null !== $ this -> rejection_serializer ? new Node \Arg ($ this -> rejection_serializer ) : new Node \Arg (new Node \Expr \Variable ('input ' )),
75
+ null !== $ exclusion -> rejectionSerializer ? new Node \Arg ($ exclusion -> rejectionSerializer ) : new Node \Arg (new Node \Expr \Variable ('input ' )),
76
76
$ exclusion ->reason ? new Node \Arg ($ exclusion ->reason ) : new Node \Arg (
77
77
new Node \Expr \ConstFetch (
78
78
new Node \Name (null )
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ class Exclusion
10
10
{
11
11
public function __construct (
12
12
public Expr $ when ,
13
- public ?Expr $ reason = null
13
+ public ?Expr $ reason = null ,
14
+ public ?Expr $ rejectionSerializer = null
14
15
){}
15
16
}
Original file line number Diff line number Diff line change @@ -73,11 +73,9 @@ public function compile(array $config): Repository\Reject
73
73
new Filtering \DTO \Exclusion (
74
74
compileExpression ($ interpreter , $ condition ['when ' ]),
75
75
compileValueWhenExpression ($ interpreter , $ condition ['reason ' ]) ?: null ,
76
+ compileExpression ($ interpreter , $ condition ['rejection_serializer ' ]) ?: null
76
77
),
77
78
);
78
- if (\array_key_exists ('rejection_serializer ' , $ condition )) {
79
- $ builder ->withRejectionSerializer (compileExpression ($ interpreter , $ condition ['rejection_serializer ' ]));
80
- }
81
79
}
82
80
83
81
return $ repository ;
You can’t perform that action at this time.
0 commit comments