Skip to content

Instantly share code, notes, and snippets.

@edhaase
Last active June 18, 2016 13:30
Show Gist options
  • Save edhaase/c94e212a617a2818645455a97bdc6fae to your computer and use it in GitHub Desktop.
Save edhaase/c94e212a617a2818645455a97bdc6fae to your computer and use it in GitHub Desktop.
function progressGen(ProgressBar $bar, $itr)
{
$bar->start();
try {
foreach($itr as $k => $v) {
yield $k => $v;
$bar->advance();
}
} finally {
$bar->finish();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment