Completed
Push — master ( 9abf36...7af07c )
by Nils
02:14
created

GuzzleClient::setOption()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
3
namespace whm\Smoke\Http;
4
5
use phm\HttpWebdriverClient\Http\Client\Guzzle\GuzzleClient as phmGuzzleClient;
6
use phm\HttpWebdriverClient\Http\Client\Decorator\FileCacheDecorator;
7
use phm\HttpWebdriverClient\Http\Client\Decorator\LoggerDecorator;
8
use phm\HttpWebdriverClient\Http\Client\HttpClient;
9
use Psr\Http\Message\RequestInterface;
10
11
class GuzzleClient implements HttpClient
12
{
13
    /**
14
     * @var phmGuzzleClient
15
     */
16
    private $guzzleClient;
17
18
    public function init($nocache = false)
19
    {
20
        if ($nocache) {
21
            $this->guzzleClient = new phmGuzzleClient();
22
        } else {
23
            $guzzleClient = new phmGuzzleClient;
24
            $this->guzzleClient = new FileCacheDecorator($guzzleClient);
0 ignored issues
show
Documentation Bug introduced by
It seems like new \phm\HttpWebdriverCl...ecorator($guzzleClient) of type object<phm\HttpWebdriver...tor\FileCacheDecorator> is incompatible with the declared type object<phm\HttpWebdriver...nt\Guzzle\GuzzleClient> of property $guzzleClient.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
25
        }
26
    }
27
28
    public function sendRequest(RequestInterface $request)
29
    {
30
        return $this->guzzleClient->sendRequest($request);
31
    }
32
33
    public function sendRequests(array $requests)
34
    {
35
        return $this->guzzleClient->sendRequests($requests);
36
    }
37
38
    public function getClientType()
39
    {
40
        return $this->guzzleClient->getClientType();
41
    }
42
43
    public function close()
44
    {
45
46
    }
47
48
    public function setOption($key, $value)
49
    {
50
        $this->guzzleClient->setOption($key, $value);
51
    }
52
}
53