projects
/
m6w6
/
seekat
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
flush
[m6w6/seekat]
/
examples
/
promise.php
diff --git
a/examples/promise.php
b/examples/promise.php
index c26e91131fee05377d99e8cf6ab74b8b159d3901..cee5c74a9652bb2d66392a8f3d6f6e3afc3845fe 100755
(executable)
--- a/
examples/promise.php
+++ b/
examples/promise.php
@@
-4,16
+4,14
@@
require_once __DIR__."/../vendor/autoload.php";
use seekat\API;
require_once __DIR__."/../vendor/autoload.php";
use seekat\API;
-use seekat\API\Future;
-$log = new Monolog\Logger("seekat");
-$log->pushHandler((new Monolog\Handler\StreamHandler(STDERR))->setLevel(Monolog\Logger::NOTICE));
-
-$api = new API(Future\amp(), API\auth("token", getenv("GITHUB_TOKEN")), null, null, $log);
+$api = new API(API\Future\amp(), API\auth("token", getenv("GITHUB_TOKEN")));
$api->users->m6w6->gists()->when(function($error, $gists) {
$api->users->m6w6->gists()->when(function($error, $gists) {
+ $error and die($error);
foreach ($gists as $gist) {
$gist->commits()->when(function($error, $commits) use($gist) {
foreach ($gists as $gist) {
$gist->commits()->when(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 ?: "<no title>");
foreach ($commits as $i => $commit) {
if (!$i) {
printf("\nGist %s, %s:\n", $gist->id, $gist->description ?: "<no title>");