1 | <?php |
||
16 | class Connection extends \hiqdev\hiart\rest\Connection implements ConnectionInterface |
||
17 | { |
||
18 | public $queryBuilderClass = QueryBuilder::class; |
||
19 | |||
20 | private $app; |
||
21 | |||
22 | public function __construct(Application $app, $config = []) |
||
27 | |||
28 | /** |
||
29 | * Fixes response: |
||
30 | * - if batch - don't touch |
||
31 | * - if single: [] => null, else get first item |
||
32 | * @param ResponseInterface $response |
||
33 | * @return bool if response doesn't need to be checked for error |
||
34 | */ |
||
35 | protected function fixResponse(ResponseInterface $response) |
||
47 | |||
48 | /** |
||
49 | * @param ResponseInterface $response |
||
50 | * @param array|null $data |
||
51 | */ |
||
52 | protected function setResponseData(ResponseInterface $response, $data) |
||
59 | |||
60 | /** |
||
61 | * Calls fixResponse. |
||
62 | * @param ResponseInterface $response |
||
63 | * @return string|false error text or false |
||
64 | */ |
||
65 | public function getResponseError(ResponseInterface $response) |
||
84 | |||
85 | /** |
||
86 | * @param ResponseInterface $response |
||
87 | * @return bool |
||
88 | */ |
||
89 | public function isError(ResponseInterface $response) |
||
102 | |||
103 | private function isRawDataEmpty(ResponseInterface $response) |
||
107 | |||
108 | private function getError(ResponseInterface $response) |
||
121 | |||
122 | /** |
||
123 | * Gets auth data from user. |
||
124 | * @return array |
||
125 | */ |
||
126 | public function getAuth() |
||
134 | } |
||
135 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: