Passed
Push — master ( 063866...82c940 )
by Darío
02:54 queued 01:26
created

ClientAdapter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 7
c 1
b 0
f 1
dl 0
loc 14
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A request() 0 4 1
A call() 0 6 1
1
<?php
2
3
namespace EasyHttp\LayerContracts\Tests\Unit\Example;
4
5
use EasyHttp\LayerContracts\Contracts\HttpClientAdapter;
6
use EasyHttp\LayerContracts\Contracts\HttpClientRequest;
7
use EasyHttp\LayerContracts\Contracts\HttpClientResponse;
8
9
class ClientAdapter implements HttpClientAdapter
10
{
11
    public function request(HttpClientRequest $request): HttpClientResponse
12
    {
13
        $response = $this->call($request->getMethod(), $request->getUri());
14
        return new ClientResponse($response);
15
    }
16
17
    private function call(string $method, string $uri): array
0 ignored issues
show
Unused Code introduced by
The parameter $uri is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

17
    private function call(string $method, /** @scrutinizer ignore-unused */ string $uri): array

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $method is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

17
    private function call(/** @scrutinizer ignore-unused */ string $method, string $uri): array

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
18
    {
19
        return [
20
            'status' => 200,
21
            'headers' => ['Server' => 'Apache/2.4.38 (Debian)'],
22
            'body' => '{"key":"value"}',
23
        ];
24
    }
25
}