1 | <?php |
||
19 | class HttpClient implements HttpClientInterface |
||
20 | { |
||
21 | /** |
||
22 | * @var HttpClientInterface |
||
23 | */ |
||
24 | protected $client; |
||
25 | |||
26 | /** |
||
27 | * @var DocumentHydrator |
||
28 | */ |
||
29 | protected $hydrator; |
||
30 | |||
31 | /** |
||
32 | * HttpClient constructor. |
||
33 | * |
||
34 | * @param HttpClientInterface $client |
||
35 | * @param DocumentHydrator $hydrator |
||
36 | */ |
||
37 | 3 | public function __construct(HttpClientInterface $client, DocumentHydrator $hydrator) |
|
42 | |||
43 | /** |
||
44 | * {@inheritdoc} |
||
45 | */ |
||
46 | 3 | public function request(RequestInterface $request): ResponseInterface |
|
68 | |||
69 | /** |
||
70 | * Create a JsonApi document by serialized data from stream |
||
71 | * |
||
72 | * @param StreamInterface $stream |
||
73 | * @return AbstractDocument |
||
74 | */ |
||
75 | 1 | protected function streamToDocument(StreamInterface $stream): AbstractDocument |
|
86 | |||
87 | /** |
||
88 | * Create a stream contains serialized JsonApi-document |
||
89 | * |
||
90 | * @param AbstractDocument $document |
||
91 | * @return StreamInterface |
||
92 | */ |
||
93 | 1 | protected function documentToStream(AbstractDocument $document): StreamInterface |
|
108 | } |