1 | <?php |
||
16 | class RestApiBrowser |
||
17 | { |
||
18 | /** @var HttpClient */ |
||
19 | private $httpClient; |
||
20 | |||
21 | /** @var RequestInterface */ |
||
22 | private $request; |
||
23 | |||
24 | /** @var ResponseInterface */ |
||
25 | private $response; |
||
26 | |||
27 | /** @var array */ |
||
28 | private $requestHeaders = []; |
||
29 | |||
30 | /** @var ResponseStorage */ |
||
31 | private $responseStorage; |
||
32 | |||
33 | /** @var string */ |
||
34 | private $host; |
||
35 | |||
36 | /** @var MessageFactoryDiscovery */ |
||
37 | private $messageFactory; |
||
38 | |||
39 | /** |
||
40 | * @param string $host |
||
41 | */ |
||
42 | public function __construct($host, HttpClient $httpClient = null) |
||
48 | |||
49 | /** |
||
50 | * Allow to override the httpClient to use yours with specific middleware for example |
||
51 | */ |
||
52 | public function useHttpClient(HttpClient $httpClient) |
||
56 | |||
57 | /** |
||
58 | * @param ResponseStorage $responseStorage |
||
59 | */ |
||
60 | public function enableResponseStorage(ResponseStorage $responseStorage) |
||
64 | |||
65 | /** |
||
66 | * @return ResponseInterface |
||
67 | */ |
||
68 | public function getResponse() |
||
72 | |||
73 | /** |
||
74 | * @param ResponseInterface $response |
||
75 | */ |
||
76 | public function setResponse(ResponseInterface $response) |
||
80 | |||
81 | public function getRequest() |
||
85 | |||
86 | public function getRequestHeaders() |
||
90 | |||
91 | /** |
||
92 | * @param string $method |
||
93 | * @param string $uri |
||
94 | * @param string|array $body |
||
95 | */ |
||
96 | public function sendRequest($method, $uri, $body = null) |
||
109 | |||
110 | public function sendRequestUntil($method, $uri, $body, callable $assertion, $maxExecutionTime = 10) |
||
123 | |||
124 | /** |
||
125 | * @param string $name |
||
126 | * @param string $value |
||
127 | */ |
||
128 | public function setRequestHeader($name, $value) |
||
133 | |||
134 | /** |
||
135 | * @param string $name |
||
136 | * @param string $value |
||
137 | */ |
||
138 | public function addRequestHeader($name, $value) |
||
146 | |||
147 | /** |
||
148 | * @param string $headerName |
||
149 | */ |
||
150 | private function removeRequestHeader($headerName) |
||
156 | |||
157 | /** |
||
158 | * @param string $uri |
||
159 | * |
||
160 | * @return bool |
||
161 | */ |
||
162 | private function hasHost($uri) |
||
166 | } |
||
167 |
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..