add some delete examples
This commit is contained in:
22
src/delete_nags.php
Executable file
22
src/delete_nags.php
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/php
|
||||
<?php
|
||||
/*****************************************************
|
||||
* This will process all issues that match "NAG!":
|
||||
* 1. Delete any comments that body exactly match "NAG!"
|
||||
******************************************************/
|
||||
|
||||
// load the config, create the connection and load the repo sepcified on the cmd line args
|
||||
// we will then have $client and $repo available
|
||||
require('setup.php');
|
||||
|
||||
//callback function to process the issues
|
||||
$tmp=function($issue) use ($repo){
|
||||
foreach($issue->getComments() as $comment){
|
||||
if($comment->body=='NAG!'){
|
||||
$repo->deleteComment($comment);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//do the search and process the results
|
||||
$repo->forIssues($tmp,['q'=>'NAG!']);
|
Reference in New Issue
Block a user