GuzzleDriver   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 22
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A execute() 0 5 1
1
<?php
2
3
namespace BitWasp\Bitcoind\Guzzle;
4
5
use GuzzleHttp\Client;
6
use Nbobtc\Http\Driver\DriverInterface;
7
use Psr\Http\Message\RequestInterface;
8
9
class GuzzleDriver implements DriverInterface
10
{
11
    /**
12
     * @var \GuzzleHttp\Client
13
     */
14
    private $client;
15
16
    public function __construct(Client $client)
17
    {
18
        $this->client = $client;
19
    }
20
21
    /**
22
     * @param RequestInterface $request
23
     * @return mixed|\Psr\Http\Message\ResponseInterface
24
     */
25
    public function execute(RequestInterface $request)
26
    {
27
        $request = $request->withMethod('POST');
28
        return $this->client->send($request);
29
    }
30
}
31