nur-sery/tbin/legacy-test-nested-actions.php

35 lines
918 B
PHP
Raw Normal View History

2024-05-16 17:51:05 +04:00
#!/usr/bin/php
<?php
require(__DIR__.'/../vendor/autoload.php');
use nur\cli\Application;
use nur\sery\output\IMessenger;
use nur\sery\output\msg;
use nur\sery\UserException;
Application::run(new class extends Application {
function main() {
msg::section("ma section");
msg::action("first", function (IMessenger $msg) {
msg::action("second", function (IMessenger $msg) {
msg::action("third", function (IMessenger $msg) {
$msg->info("hello world");
2024-05-16 18:03:21 +04:00
$msg->asuccess();
2024-05-16 17:51:05 +04:00
});
$msg->asuccess();
});
2024-05-16 18:03:21 +04:00
$msg->asuccess();
2024-05-16 17:51:05 +04:00
});
msg::action("first2", function (IMessenger $msg) {
msg::action("second2", function (IMessenger $msg) {
msg::action("third2", function (IMessenger $msg) {
$msg->info("hello world2");
2024-05-16 18:03:21 +04:00
$msg->asuccess();
2024-05-16 17:51:05 +04:00
});
$msg->asuccess();
});
2024-05-16 18:03:21 +04:00
$msg->asuccess();
2024-05-16 17:51:05 +04:00
});
}
});