update to PHP-8.1
[m6w6/seekat] / examples / cli.php
index fc72130200e41c390d9342d50e84057ca98bba01..6da88150cbe9e7ab5da089feefb4a36a46eb1c5b 100755 (executable)
@@ -1,25 +1,22 @@
 #!/usr/bin/env php
 <?php
 
-require_once __DIR__."/../vendor/autoload.php";
+$api = include "examples.inc";
 
-$api = new seekat\API(seekat\API\Future\react(), [
-       "Authorization" => "token ".getenv("GITHUB_TOKEN")
-]);
 array_shift($argv);
 
-($self = function($error, $api) use(&$self) {
+($self = function($api) use(&$self) {
        global $argv;
 
        while (null !== ($arg = array_shift($argv))) {
                if ("." === $arg) {
-                       $api->when($self);
+                       $api->then($self);
                        return;
                }
                $api = $api->$arg;
        }
 
        echo $api, "\n";
-})(null, $api);
+})($api);
 
 $api->send();