@@ -245,8 +245,7 @@ public function mergeRequests($page = 1, $per_page = Api::PER_PAGE)
245
245
246
246
public function mergeRequest ($ id )
247
247
{
248
- $ mr = new MergeRequest ($ this , $ id );
249
- $ mr ->setClient ($ this ->getClient ());
248
+ $ mr = new MergeRequest ($ this , $ id , $ this ->getClient ());
250
249
251
250
return $ mr ->show ();
252
251
}
@@ -258,6 +257,34 @@ public function createMergeRequest($source, $target, $title, $assignee = null)
258
257
return MergeRequest::fromArray ($ this ->getClient (), $ this , $ data );
259
258
}
260
259
260
+ public function updateMergeRequest ($ id , array $ params )
261
+ {
262
+ $ mr = new MergeRequest ($ this , $ id , $ this ->getClient ());
263
+
264
+ return $ mr ->update ($ params );
265
+ }
266
+
267
+ public function closeMergeRequest ($ id )
268
+ {
269
+ $ mr = new MergeRequest ($ this , $ id , $ this ->getClient ());
270
+
271
+ return $ mr ->close ();
272
+ }
273
+
274
+ public function openMergeRequest ($ id )
275
+ {
276
+ $ mr = new MergeRequest ($ this , $ id , $ this ->getClient ());
277
+
278
+ return $ mr ->open ();
279
+ }
280
+
281
+ public function mergeMergeRequest ($ id )
282
+ {
283
+ $ mr = new MergeRequest ($ this , $ id , $ this ->getClient ());
284
+
285
+ return $ mr ->merge ();
286
+ }
287
+
261
288
public function issues ($ page = 1 , $ per_page = Api::PER_PAGE )
262
289
{
263
290
$ data = $ this ->api ('issues ' )->all ($ this ->id , $ page , $ per_page );
@@ -280,24 +307,21 @@ public function createIssue($title, array $params = array())
280
307
281
308
public function issue ($ id )
282
309
{
283
- $ issue = new Issue ($ this , $ id );
284
- $ issue ->setClient ($ this ->getClient ());
310
+ $ issue = new Issue ($ this , $ id , $ this ->getClient ());
285
311
286
312
return $ issue ->show ();
287
313
}
288
314
289
315
public function updateIssue ($ id , array $ params )
290
316
{
291
- $ issue = new Issue ($ this , $ id );
292
- $ issue ->setClient ($ this ->getClient ());
317
+ $ issue = new Issue ($ this , $ id , $ this ->getClient ());
293
318
294
319
return $ issue ->update ($ params );
295
320
}
296
321
297
322
public function removeIssue ($ id )
298
323
{
299
- $ issue = new Issue ($ this , $ id );
300
- $ issue ->setClient ($ this ->getClient ());
324
+ $ issue = new Issue ($ this , $ id , $ this ->getClient ());
301
325
302
326
return $ issue ->remove ();
303
327
}
@@ -324,16 +348,14 @@ public function createMilestone($title, array $params = array())
324
348
325
349
public function milestone ($ id )
326
350
{
327
- $ milestone = new Milestone ($ this , $ id );
328
- $ milestone ->setClient ($ this ->getClient ());
351
+ $ milestone = new Milestone ($ this , $ id , $ this ->getClient ());
329
352
330
353
return $ milestone ->show ();
331
354
}
332
355
333
356
public function updateMilestone ($ id , array $ params )
334
357
{
335
- $ milestone = new Milestone ($ this , $ id );
336
- $ milestone ->setClient ($ this ->getClient ());
358
+ $ milestone = new Milestone ($ this , $ id , $ this ->getClient ());
337
359
338
360
return $ milestone ->update ($ params );
339
361
}
0 commit comments