X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fseekat;a=blobdiff_plain;f=examples%2Fpromise.php;h=e1f5b9d4fbd4a3311e322fe2706d6ffa11423928;hp=cee5c74a9652bb2d66392a8f3d6f6e3afc3845fe;hb=HEAD;hpb=e368287b3cd2dd40945ac8d1a1946bc32268007d diff --git a/examples/promise.php b/examples/promise.php index cee5c74..b39890d 100755 --- a/examples/promise.php +++ b/examples/promise.php @@ -1,23 +1,19 @@ #!/usr/bin/env php users->m6w6->gists()->when(function($error, $gists) { +$api->users->m6w6->gists()->onResolve(function($error, $gists) { $error and die($error); foreach ($gists as $gist) { - $gist->commits()->when(function($error, $commits) use($gist) { + $gist->commits()->onResolve(function($error, $commits) use($gist) { $error and die($error); foreach ($commits as $i => $commit) { if (!$i) { printf("\nGist %s, %s:\n", $gist->id, $gist->description ?: ""); } $cs = $commit->change_status; - printf("\t%s: ", substr($commit->version,0,8)); + printf("\t%s: ", substr($commit->version, 0, 8)); printf("-%s+%s=%s\n", $cs->deletions, $cs->additions, $cs->total); } });