Code Duplication    Length = 9-9 lines in 6 locations

src/Payant.php 6 locations

@@ 280-288 (lines=9) @@
277
    * @param  string $reference_code [Mandatory - Invoice Reference Code]
278
    * @return object               
279
    */
280
    public function getInvoice(string $reference_code){
281
        if(!$reference_code){
282
            throw new IsNullOrInvalid("Error Processing Request - Null/Invalid reference_code");
283
        }
284
285
        $url = "/invoices/{$reference_code}";
286
287
        return $this->sendRequest('get', $url);
288
    }
289
290
291
@@ 299-307 (lines=9) @@
296
    * @param  string $reference_code [Mandatory - Invoice Reference Code]
297
    * @return object               
298
    */
299
    public function sendInvoice(string $reference_code = null){
300
        if(!$reference_code){
301
            throw new IsNullOrInvalid("Error Processing Request - Null/Invalid reference_code");
302
        }
303
304
            $url = "/invoices/send/{$reference_code}";
305
306
            return $this->sendRequest('get', $url);
307
    }
308
309
310
@@ 341-349 (lines=9) @@
338
    * @param  string $reference_code [Mandatory - Invoice Reference Code]
339
    * @return object                 
340
    */
341
    public function deleteInvoice(string $reference_code){
342
        if(!$reference_code){
343
            throw new IsNullOrInvalid("Error Processing Request - Null/Invalid reference_code");
344
        }
345
346
        $url = "/invoices/{$reference_code}";
347
348
        return $this->sendRequest('delete', $url);
349
    }
350
351
352
@@ 394-402 (lines=9) @@
391
    * @param  string $reference_code [Mandatory - Transfer Reference Code]
392
    * @return object               
393
    */
394
    public function getTransfer(string $reference_code){
395
        if(!$reference_code){
396
            throw new IsNullOrInvalid("Error Processing Request - Null/Invalid reference_code");
397
        }
398
399
        $url = "/transfers/{$reference_code}";
400
401
        return $this->sendRequest('get', $url);
402
    }
403
404
405
@@ 438-446 (lines=9) @@
435
    * @param  string $reference_code [Mandatory - Invoice Reference Code]
436
    * @return object                 
437
    */
438
    public function deleteTransfer(string $reference_code){
439
        if(!$reference_code){
440
            throw new IsNullOrInvalid("Error Processing Request - Null/Invalid reference_code");
441
        }
442
443
        $url = "/transfers/{$reference_code}";
444
445
        return $this->sendRequest('delete', $url);
446
    }
447
448
449
@@ 503-511 (lines=9) @@
500
    * @param string $reference_code [Mandatory - Invoice Reference Code]
501
    * @return object
502
    */
503
    public function getPayment(string $reference_code){
504
        if(!$reference_code){
505
            throw new IsNullOrInvalid("Error Processing Request - Null/Invalid reference_code");
506
        }
507
508
        $url = "/payments/{$reference_code}";
509
510
        return $this->sendRequest('get', $url);
511
    }
512
513
    
514