From 8d6932c49b23d34fccf2c82f6b2acc0fc6d4bfb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20PLANCHAT?= Date: Tue, 10 Dec 2024 14:54:43 +0100 Subject: [PATCH 1/2] Update Drop.php --- src/Plugin/Filtering/Builder/Drop.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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'), + ), + ], ), ), ), From 73c64deedeea0e6feebfb7bfbff18742019ea6c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20PLANCHAT?= Date: Tue, 10 Dec 2024 15:47:11 +0100 Subject: [PATCH 2/2] Update Reject.php --- src/Plugin/Filtering/Builder/Reject.php | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) 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'), + ), + ], ), ), ),