1 | <?php |
||
13 | class JsonProvider |
||
14 | { |
||
15 | |||
16 | /** |
||
17 | * |
||
18 | * @var HttpClient |
||
19 | */ |
||
20 | private $httpClient; |
||
21 | |||
22 | /** |
||
23 | * Query the duck duck go api |
||
24 | * |
||
25 | * @param string $query |
||
26 | * Keywords to start a query for |
||
27 | * @return string The payload |
||
28 | */ |
||
29 | 2 | public function query(string $query): string |
|
44 | |||
45 | /** |
||
46 | * Provide an URL object out of given duckduckgo query |
||
47 | * @param string $query |
||
48 | * @return Url |
||
49 | */ |
||
50 | 2 | private function provideUrl(string $query): Url |
|
56 | } |
||
57 |