Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clue/fa6b953e841cf77b18fa95fa1f48f599 to your computer and use it in GitHub Desktop.
Save clue/fa6b953e841cf77b18fa95fa1f48f599 to your computer and use it in GitHub Desktop.
function main(): PromiseInterface {
return $this->query(1);
}
function query(page): PromiseInterface {
return $this
->makeAQuery(page)
->then($result) {
// This is NOT called properly
// Do whatever
if (page <= 10) {
$this->query(page+1);
return;
}
});
}
function makeAQuery($page): PromiseInterface {
return $this
->repository
->query($page)
->then(function(Response $response) {
// This is called properly
return // formatResponse
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment