Passed
Push — master ( fba6d0...6e0d1d )
by Mariano
04:54
created

GuzzlePsr18Client::sendRequest()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Mcustiel\Phiremock\Client\Utils\Http;
4
5
use GuzzleHttp\Client as GuzzleClient;
6
use Psr\Http\Client\ClientInterface;
7
use Psr\Http\Message\RequestInterface;
8
use Psr\Http\Message\ResponseInterface;
9
10
class GuzzlePsr18Client implements ClientInterface
11
{
12
    /** @var GuzzleClient */
13
    private $client;
14
15
    public function __construct(GuzzleClient $client = null)
16
    {
17
        $this->client = $client ?? new GuzzleClient(['allow_redirects' => false]);
18
    }
19
20
    public function sendRequest(RequestInterface $request): ResponseInterface
21
    {
22
        return $this->client->send($request);
23
    }
24
}
25