File tree Expand file tree Collapse file tree 3 files changed +5
-6
lines changed Expand file tree Collapse file tree 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
7070 new Node \Expr \Variable ('input ' ),
7171 new Node \Expr \Yield_ (
7272 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),
7474 [
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 ' )),
7676 $ exclusion ->reason ? new Node \Arg ($ exclusion ->reason ) : new Node \Arg (
7777 new Node \Expr \ConstFetch (
7878 new Node \Name (null )
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ class Exclusion
1010{
1111 public function __construct (
1212 public Expr $ when ,
13- public ?Expr $ reason = null
13+ public ?Expr $ reason = null ,
14+ public ?Expr $ rejectionSerializer = null
1415 ){}
1516}
Original file line number Diff line number Diff line change @@ -73,11 +73,9 @@ public function compile(array $config): Repository\Reject
7373 new Filtering \DTO \Exclusion (
7474 compileExpression ($ interpreter , $ condition ['when ' ]),
7575 compileValueWhenExpression ($ interpreter , $ condition ['reason ' ]) ?: null ,
76+ compileExpression ($ interpreter , $ condition ['rejection_serializer ' ]) ?: null
7677 ),
7778 );
78- if (\array_key_exists ('rejection_serializer ' , $ condition )) {
79- $ builder ->withRejectionSerializer (compileExpression ($ interpreter , $ condition ['rejection_serializer ' ]));
80- }
8179 }
8280
8381 return $ repository ;
You can’t perform that action at this time.
0 commit comments