DummyHttpClient   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 16
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A sendRequest() 0 3 1
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