1 | <?php |
||
26 | abstract class AbstractApi implements ApiInterface |
||
27 | { |
||
28 | /** |
||
29 | * @var HttpAsyncClient |
||
30 | */ |
||
31 | private $httpClient; |
||
32 | |||
33 | /** |
||
34 | * @var RequestFactory |
||
35 | */ |
||
36 | private $requestFactory; |
||
37 | |||
38 | /** |
||
39 | * AbstractApi constructor. |
||
40 | * |
||
41 | * @param PluginClient $httpClient |
||
42 | * @param RequestFactory $requestFactory |
||
43 | */ |
||
44 | 2 | public function __construct(PluginClient $httpClient, RequestFactory $requestFactory) |
|
49 | |||
50 | /** |
||
51 | * @param string $method |
||
52 | * @param string $uri |
||
53 | * @param array $headers |
||
54 | * @param array|null $body |
||
55 | * |
||
56 | * @return RequestInterface |
||
57 | */ |
||
58 | protected function createRequest($method, $uri, array $headers = array(), $body = null) |
||
67 | |||
68 | /** |
||
69 | * @param RequestInterface $request |
||
70 | * |
||
71 | * @return ResponseInterface |
||
72 | */ |
||
73 | protected function sendRequest(RequestInterface $request) |
||
77 | |||
78 | /** |
||
79 | * @param RequestInterface $request |
||
80 | * |
||
81 | * @return Promise |
||
82 | */ |
||
83 | protected function sendAsyncRequest(RequestInterface $request) |
||
87 | } |
||
88 |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.