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

Caller::attemptGuzzle()   D

Complexity

Conditions 18
Paths 4

Size

Total Lines 34
Code Lines 27

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 342

Importance

Changes 2
Bugs 0 Features 0
Metric Value
dl 0
loc 34
ccs 0
cts 26
cp 0
rs 4.947
c 2
b 0
f 0
cc 18
eloc 27
nc 4
nop 4
crap 342

How to fix   Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

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