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

GuzzleAdapter::request()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 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
}