1 | <?php |
||
11 | class ApiConnection extends Connection |
||
12 | { |
||
13 | |||
14 | /** |
||
15 | * Get the default query grammar instance. |
||
16 | * |
||
17 | * @return Grammar |
||
18 | */ |
||
19 | protected function getDefaultQueryGrammar() |
||
27 | |||
28 | /** |
||
29 | * Return the host we should be connecting to. |
||
30 | * @return string |
||
31 | */ |
||
32 | private function getApiHost() |
||
36 | |||
37 | /** |
||
38 | * Extract what key in the response the data is held in (if applicable). |
||
39 | * @param string $query |
||
40 | * @return string|null |
||
41 | */ |
||
42 | private function extractJsonKey(string &$query): ?string |
||
54 | |||
55 | /** |
||
56 | * @param string $query |
||
57 | * @param mixed[] $bindings |
||
58 | * @param bool $useReadPdo |
||
59 | * @return mixed[] |
||
60 | */ |
||
61 | public function select($query, $bindings = [], $useReadPdo = true) |
||
79 | |||
80 | |||
81 | /** |
||
82 | * @param Client $client |
||
83 | * @param string $url |
||
84 | * @return mixed[] |
||
85 | */ |
||
86 | private function getResponse(Client $client, string $url): array |
||
105 | |||
106 | |||
107 | /** |
||
108 | * Is the JSON responses a paginatable one? |
||
109 | * @param mixed[] $json |
||
110 | * @return bool |
||
111 | */ |
||
112 | private function isPaginatedResponse(array $json): bool |
||
129 | } |
||
130 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: