1 | <?php |
||
15 | class Consumer |
||
16 | { |
||
17 | /** |
||
18 | * @var ClientInterface |
||
19 | */ |
||
20 | private $client; |
||
21 | |||
22 | /** |
||
23 | * @var ProviderInterface |
||
24 | */ |
||
25 | private $provider; |
||
26 | |||
27 | /** |
||
28 | * @var SerializerInterface |
||
29 | */ |
||
30 | private $serializer; |
||
31 | |||
32 | /** |
||
33 | * @var FormatNegotiatorInterface |
||
34 | */ |
||
35 | private $negotiator; |
||
36 | |||
37 | /** |
||
38 | * @param ClientInterface $client |
||
39 | * @param ProviderInterface $provider |
||
40 | * @param SerializerInterface $serializer |
||
41 | * @param FormatNegotiatorInterface $negotiator |
||
42 | */ |
||
43 | 12 | public function __construct(ClientInterface $client, ProviderInterface $provider, SerializerInterface $serializer, FormatNegotiatorInterface $negotiator) |
|
50 | |||
51 | /** |
||
52 | * @param $url |
||
53 | * @param array $params |
||
54 | * |
||
55 | * @return array |
||
56 | */ |
||
57 | 12 | public function get($url, $params = array()) |
|
67 | |||
68 | /** |
||
69 | * @param array $params |
||
70 | * @param ResponseInterface $response |
||
71 | * |
||
72 | * @return null|string |
||
73 | * |
||
74 | * @throws UnknownFormatException |
||
75 | */ |
||
76 | 12 | private function getFormat(array $params, ResponseInterface $response) |
|
93 | } |
||
94 |