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

Caller::moveArgsToSentargs()   B

Complexity

Conditions 5
Paths 7

Size

Total Lines 20
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 12
CRAP Score 5

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 20
ccs 12
cts 12
cp 1
rs 8.8571
cc 5
eloc 11
nc 7
nop 3
crap 5
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