Passed
Push — master ( 9d60a4...b0dfbc )
by Mariano
04:38
created

GuzzlePsr18Client::__construct()   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
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace Mcustiel\Phiremock\Server\Utils;
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