1 | <?php |
||
10 | class Sapi3CountingSearchService implements CountingSearchServiceInterface |
||
11 | { |
||
12 | /** |
||
13 | * @var UriInterface |
||
14 | */ |
||
15 | private $searchLocation; |
||
16 | |||
17 | /** |
||
18 | * @var HttpClient |
||
19 | */ |
||
20 | private $httpClient; |
||
21 | |||
22 | /** |
||
23 | * @var string|null |
||
24 | */ |
||
25 | private $apiKey; |
||
26 | |||
27 | /** |
||
28 | * @var array |
||
29 | */ |
||
30 | private $queryParameters; |
||
31 | |||
32 | /** |
||
33 | * @param UriInterface $searchLocation |
||
34 | * @param HttpClient $httpClient |
||
35 | * @param string|null $apiKey |
||
36 | */ |
||
37 | public function __construct( |
||
47 | |||
48 | public function withQueryParameter(string $key, $value) |
||
54 | |||
55 | /** |
||
56 | * @inheritdoc |
||
57 | */ |
||
58 | public function search(string $query): int |
||
93 | } |
||
94 |
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: