Completed
Push — master ( 27fd09...a817c1 )
by Nils
01:47
created

ChromeClient::close()   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 0
1
<?php
2
3
namespace whm\Smoke\Http;
4
5
use phm\HttpWebdriverClient\Http\Client\Chrome\ChromeClient as phmChromeClient;
6
use phm\HttpWebdriverClient\Http\Client\Decorator\FileCacheDecorator;
7
use phm\HttpWebdriverClient\Http\Client\HttpClient;
8
use Psr\Http\Message\RequestInterface;
9
10
class ChromeClient implements HttpClient
11
{
12
    /**
13
     * @var phmChromeClient
14
     */
15
    private $chromeClient;
16
17
    public function init($host = 'localhost', $port = 4444)
18
    {
19
        $chromeClient = new phmChromeClient($host, $port);
20
        $this->chromeClient = new FileCacheDecorator($chromeClient);
0 ignored issues
show
Documentation Bug introduced by
It seems like new \phm\HttpWebdriverCl...ecorator($chromeClient) of type object<phm\HttpWebdriver...tor\FileCacheDecorator> is incompatible with the declared type object<phm\HttpWebdriver...nt\Chrome\ChromeClient> of property $chromeClient.

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...
21
    }
22
23
    public function sendRequest(RequestInterface $request)
24
    {
25
        return $this->chromeClient->sendRequest($request);
26
    }
27
28
    public function sendRequests(array $requests)
29
    {
30
        return $this->chromeClient->sendRequests($requests);
31
    }
32
33
    public function getClientType()
34
    {
35
        return $this->chromeClient->getClientType();
0 ignored issues
show
Bug introduced by
The method getClientType() does not seem to exist on object<phm\HttpWebdriver...nt\Chrome\ChromeClient>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
36
    }
37
38
    public function close()
39
    {
40
        $this->chromeClient->close();
41
    }
42
}
43