Completed
Push — master ( 890e48...201e88 )
by Ibrahim
02:37
created

Caller   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 50%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 15
ccs 3
cts 6
cp 0.5
rs 10
c 2
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A callEndpoint() 0 5 1
1
<?php
2
namespace Yabacon\Paystack\Helpers;
3
4
use \Closure;
5
use \Yabacon\Paystack\Contracts\RouteInterface;
6
use \Yabacon\Paystack\Http\RequestBuilder;
7
8
class Caller
9
{
10
    private $paystackObj;
11
12 1
    public function __construct($paystackObj)
13
    {
14 1
        $this->paystackObj = $paystackObj;
15 1
    }
16
17
    public function callEndpoint($interface, $payload = [ ], $sentargs = [ ])
18
    {
19
        $builder = new RequestBuilder($this->paystackObj, $interface, $payload, $sentargs);
20
        return $builder->build()->send()->wrapUp();
21
    }
22
}
23