Skip to content

Instantly share code, notes, and snippets.

@mmoreram
Last active April 26, 2020 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mmoreram/78374ace284f87b87991cf97388205aa to your computer and use it in GitHub Desktop.
Save mmoreram/78374ace284f87b87991cf97388205aa to your computer and use it in GitHub Desktop.
function main() {
$this->query(1);
}
function query(page) {
$this
->makeAQuery(page)
->then($result) {
// This is NOT called properly
// Do whatever
if (page <= 10) {
$this->query(page+1);
return;
}
});
}
function makeAQuery($page) {
return $this
->client
->get('http://localhost.com/?p=' . $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