DummyHttpClient::sendRequest()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace CompoLab\Tests\Utils;
4
5
use GuzzleHttp\Psr7\Response;
6
use Http\Client\HttpClient;
7
use Psr\Http\Message\RequestInterface;
8
9
class DummyHttpClient implements HttpClient
10
{
11
    /**
12
     *
13
     * @var string
14
     */
15
    private $body;
16
17
    public function __construct(string $body = null)
18
    {
19
        $this->body = $body;
20
    }
21
22
    public function sendRequest(RequestInterface $request)
23
    {
24
        return new Response(200, [], $this->body);
25
    }
26
}
27