Caller   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 50%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 5
c 2
b 0
f 0
dl 0
loc 13
ccs 3
cts 6
cp 0.5
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A callEndpoint() 0 4 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