Passed
Push — master ( 13d978...f630de )
by Michael
03:07
created

GuzzleAdapter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 1
cbo 1
dl 0
loc 25
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A request() 0 4 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Mikemirten\Component\JsonApi\HttpClient\Adapter;
5
6
use GuzzleHttp\ClientInterface as GuzzleClientInterface;
7
use Mikemirten\Component\JsonApi\HttpClient\HttpClientInterface;
8
use Psr\Http\Message\RequestInterface;
9
use Psr\Http\Message\ResponseInterface;
10
11
/**
12
 * Guzzle HTTP Client adapter
13
 *
14
 * @package Mikemirten\Component\JsonApi\HttpClient
15
 */
16
class GuzzleAdapter implements HttpClientInterface
17
{
18
    /**
19
     * @var GuzzleClientInterface
20
     */
21
    protected $client;
22
23
    /**
24
     * GuzzleAdapter constructor.
25
     *
26
     * @param GuzzleClientInterface $client
27
     */
28 1
    public function __construct(GuzzleClientInterface $client)
29
    {
30 1
        $this->client = $client;
31 1
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36 1
    public function request(RequestInterface $request): ResponseInterface
37
    {
38 1
        return $this->client->send($request);
39
    }
40
}