projects
/
m6w6
/
seekat
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
update to PHP-8.1
[m6w6/seekat]
/
examples
/
hooks.php
diff --git
a/examples/hooks.php
b/examples/hooks.php
index dfcb6359d51d19bf154570cb8e761ab90cae90a8..fdeca097cb281c0921e596115c5ac0bfec2bd985 100755
(executable)
--- a/
examples/hooks.php
+++ b/
examples/hooks.php
@@
-3,20
+3,15
@@
require_once __DIR__."/../vendor/autoload.php";
require_once __DIR__."/../vendor/autoload.php";
-use seekat\{API, API\Future, API\Links};
-use Monolog\{Logger, Handler};
+use seekat\API\Links;
-$cli = new http\Client("curl", "seekat");
-$cli->configure([
+$cli
ent
= new http\Client("curl", "seekat");
+$cli
ent
->configure([
"max_host_connections" => 10,
"max_total_connections" => 50,
"use_eventloop" => true,
]);
"max_host_connections" => 10,
"max_total_connections" => 50,
"use_eventloop" => true,
]);
-
-$log = new Logger("seekat");
-$log->pushHandler(new Handler\StreamHandler(STDERR, Logger::NOTICE));
-
-$api = new API(Future\react(), API\auth("token", getenv("GITHUB_TOKEN")), null, $cli, $log);
+$api = include "examples.inc";
$api(function() use($api) {
$repos = yield $api->users->m6w6->repos([
$api(function() use($api) {
$repos = yield $api->users->m6w6->repos([
@@
-30,7
+25,8
@@
$api(function() use($api) {
foreach ($repos as $repo) {
$batch[] = $repo->hooks();
}
foreach ($repos as $repo) {
$batch[] = $repo->hooks();
}
- foreach (yield $batch as $key => $hooks) {
+ $result = yield $batch;
+ foreach ($result as $key => $hooks) {
if (!count($hooks)) {
continue;
}
if (!count($hooks)) {
continue;
}