diff --git a/src/Plugin/Filtering/Builder/Drop.php b/src/Plugin/Filtering/Builder/Drop.php index 32ae3f7e..bda1513f 100644 --- a/src/Plugin/Filtering/Builder/Drop.php +++ b/src/Plugin/Filtering/Builder/Drop.php @@ -122,7 +122,21 @@ class: new Node\Stmt\Class_(null, [ new Node\Expr\Variable('input'), new Node\Expr\Yield_( new Node\Expr\New_( - new Node\Name\FullyQualified('Kiboko\\Component\\Bucket\\RejectionResultBucket'), + class: new Node\Name\FullyQualified('Kiboko\\Component\\Bucket\\RejectionResultBucket'), + args: [ + new Node\Arg( + new Node\Expr\MethodCall( + new Node\Expr\Variable('exception'), + 'getMessage' + ), + ), + new Node\Expr\ConstFetch( + new Node\Expr\Variable('exception'), + ), + new Node\Arg( + new Node\Expr\Variable('input'), + ), + ], ), ), ), diff --git a/src/Plugin/Filtering/Builder/Reject.php b/src/Plugin/Filtering/Builder/Reject.php index 12bfdfb6..82639e52 100644 --- a/src/Plugin/Filtering/Builder/Reject.php +++ b/src/Plugin/Filtering/Builder/Reject.php @@ -122,10 +122,23 @@ class: new Node\Stmt\Class_(null, [ new Node\Expr\Variable('input'), new Node\Expr\Yield_( new Node\Expr\New_( - new Node\Name\FullyQualified('Kiboko\\Component\\Bucket\\RejectionResultBucket'), - [ - new Node\Arg(new Node\Expr\Variable('input')), - ] + class: new Node\Name\FullyQualified( + \Kiboko\Component\Bucket\RejectionResultBucket::class + ), + args: [ + new Node\Arg( + new Node\Expr\MethodCall( + new Node\Expr\Variable('exception'), + 'getMessage' + ), + ), + new Node\Expr\ConstFetch( + new Node\Expr\Variable('exception'), + ), + new Node\Arg( + new Node\Expr\Variable('input'), + ), + ], ), ), ),