diff --git a/src/close_all.php b/src/close_all.php index ffc5f74..9f22e76 100755 --- a/src/close_all.php +++ b/src/close_all.php @@ -5,11 +5,12 @@ ******************/ // load the config, create the connection and load the repo sepcified on the cmd line args -// we will then have $client and $repo available +// we will then have $client and $repo available require('setup.php'); -//close all issues -$repo->forIssues(function($issue){ +// close all issues +// we use getIssues() here rather than forIssues() (see https://git.jhodges.co.uk/jhodges/GiteaBot/issues/1) +foreach($repo->getIssues() as $issue){ $issue->state='closed'; $issue->save(); -}); +}