From 502331664e0e0c0615f5b6e5bdb0e8b1d7feaec7 Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Thu, 16 May 2024 18:03:21 +0400 Subject: [PATCH] suivi action --- src/output/std/ProxyMessenger.php | 17 ++++++++++++++++- ...ction.php => legacy-test-nested-actions.php} | 8 ++++---- 2 files changed, 20 insertions(+), 5 deletions(-) rename tbin/{legacy-test-action.php => legacy-test-nested-actions.php} (82%) diff --git a/src/output/std/ProxyMessenger.php b/src/output/std/ProxyMessenger.php index 14cc99e..08c07ab 100644 --- a/src/output/std/ProxyMessenger.php +++ b/src/output/std/ProxyMessenger.php @@ -1,6 +1,7 @@ msgs as $msg) { + if ($result === true) $msg->asuccess(); + elseif ($result === false) $msg->afailure(); + else $msg->adone($result); + } + } + } catch (Exception $e) { + /** @var _IMessenger $msg */ + foreach ($this->msgs as $msg) { + $msg->afailure($e); + } + throw $e; } finally { /** @var _IMessenger $msg */ $index = 0; diff --git a/tbin/legacy-test-action.php b/tbin/legacy-test-nested-actions.php similarity index 82% rename from tbin/legacy-test-action.php rename to tbin/legacy-test-nested-actions.php index c56a70f..fd8bbf7 100755 --- a/tbin/legacy-test-action.php +++ b/tbin/legacy-test-nested-actions.php @@ -14,21 +14,21 @@ Application::run(new class extends Application { msg::action("second", function (IMessenger $msg) { msg::action("third", function (IMessenger $msg) { $msg->info("hello world"); - $msg->asuccess(null, msg::DEBUG); + $msg->asuccess(); }); $msg->asuccess(); }); - $msg->asuccess(null, msg::DEBUG); + $msg->asuccess(); }); msg::action("first2", function (IMessenger $msg) { msg::action("second2", function (IMessenger $msg) { msg::action("third2", function (IMessenger $msg) { $msg->info("hello world2"); - $msg->asuccess(null, msg::DEBUG); + $msg->asuccess(); }); $msg->asuccess(); }); - $msg->asuccess(null, msg::DEBUG); + $msg->asuccess(); }); } });