| 1 | <?php |
||
| 8 | abstract class Request |
||
| 9 | { |
||
| 10 | |||
| 11 | /** |
||
| 12 | * @var Client |
||
| 13 | */ |
||
| 14 | protected $client; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | protected $login; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var string |
||
| 23 | */ |
||
| 24 | protected $password; |
||
| 25 | |||
| 26 | public function __construct(GuzzleHttpClient $http) |
||
| 30 | |||
| 31 | |||
| 32 | /** |
||
| 33 | * @param string $login |
||
| 34 | * @param string $password |
||
| 35 | * @return $this |
||
| 36 | */ |
||
| 37 | public function setCredentials($login, $password) |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Make the request to API |
||
| 47 | * |
||
| 48 | * @param string $action |
||
| 49 | * @param array $params |
||
| 50 | * @return array|null |
||
| 51 | */ |
||
| 52 | public function exec($action, $params = []) |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @param array $params |
||
| 63 | * @return string |
||
| 64 | */ |
||
| 65 | protected function createRequestBody(array $params) |
||
| 77 | |||
| 78 | /** |
||
| 79 | * @param array $requestBody |
||
| 80 | * @return mixed |
||
| 81 | */ |
||
| 82 | abstract protected function formatRequestBody(array $requestBody); |
||
| 83 | |||
| 84 | /** |
||
| 85 | * @param string $response |
||
| 86 | * @return array |
||
| 87 | */ |
||
| 88 | abstract protected function parseResponse($response); |
||
| 89 | |||
| 90 | /** |
||
| 91 | * @param string $action |
||
| 92 | * @return string |
||
| 93 | */ |
||
| 94 | abstract protected function makeEndPoint($action); |
||
| 95 | } |
||
| 96 |
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..