1 | <?php |
||
8 | abstract class Request implements RequestInterface |
||
9 | { |
||
10 | static public $allowedMethod = []; |
||
11 | |||
12 | /** |
||
13 | * @var HttpInterface |
||
14 | */ |
||
15 | protected $client; |
||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $login; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | protected $password; |
||
26 | |||
27 | public function __construct(HttpInterface $http) |
||
31 | |||
32 | |||
33 | /** |
||
34 | * @param string $login |
||
35 | * @param string $password |
||
36 | * @return $this |
||
37 | */ |
||
38 | public function setCredentials($login, $password) |
||
45 | |||
46 | /** |
||
47 | * Make the request to API |
||
48 | * |
||
49 | * @param string $action |
||
50 | * @param array $params |
||
51 | * @return array|null |
||
52 | */ |
||
53 | public function exec($action, $params = []) |
||
61 | |||
62 | /** |
||
63 | * @param array $params |
||
64 | * @return string |
||
65 | */ |
||
66 | protected function createRequestBody(array $params) |
||
78 | |||
79 | /** |
||
80 | * @param array $requestBody |
||
81 | * @return mixed |
||
82 | */ |
||
83 | abstract protected function formatRequestBody(array $requestBody); |
||
84 | |||
85 | /** |
||
86 | * @param string $response |
||
87 | * @return array |
||
88 | */ |
||
89 | abstract protected function parseResponse($response); |
||
90 | |||
91 | /** |
||
92 | * @param string $action |
||
93 | * @return string |
||
94 | */ |
||
95 | abstract public function makeEndPoint($action); |
||
96 | } |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: