1 | <?php |
||
12 | class WordSelectorProxyAdapter implements AdapterInterface |
||
13 | { |
||
14 | const GET_RANDOM_WORD_METHOD = 'getRandomWord'; |
||
15 | |||
16 | const LENGTH_OPTION = 'length'; |
||
17 | const LANG_OPTION = 'lang'; |
||
18 | const COMPLEXITY_OPTION = 'complexity'; |
||
19 | |||
20 | const WORD_RESPONSE = 'word'; |
||
21 | const LANG_RESPONSE = 'lang'; |
||
22 | const COMPLEXITY_RESPONSE = 'complexity'; |
||
23 | |||
24 | const ERROR_RESPONSE = 'error'; |
||
25 | |||
26 | const API_ENDPOINT = '/random'; |
||
27 | const HTTP_METHOD = 'GET'; |
||
28 | |||
29 | /** |
||
30 | * @var Client |
||
31 | */ |
||
32 | private $client; |
||
33 | |||
34 | /** |
||
35 | * Construct |
||
36 | * |
||
37 | * @param Client $client |
||
38 | */ |
||
39 | 18 | public function __construct(Client $client) |
|
43 | |||
44 | /** |
||
45 | * Call remote object |
||
46 | * |
||
47 | * @param string $wrappedClass |
||
48 | * @param string $method |
||
49 | * @param array $params |
||
50 | * @return string |
||
51 | */ |
||
52 | 18 | public function call($wrappedClass, $method, array $params = []) |
|
91 | } |
||
92 |