1 | <?php |
||
9 | class ResponseConverter |
||
10 | { |
||
11 | /** |
||
12 | * Convert a PSR-7 response to a data type you want to work with. |
||
13 | * |
||
14 | * @param ResponseInterface $response |
||
15 | * @param string $requestFormat |
||
16 | * @param string $dataType |
||
17 | * |
||
18 | * @return ResponseInterface|\Psr\Http\Message\StreamInterface|\SimpleXMLElement|string |
||
19 | * |
||
20 | * @throws InvalidArgumentException |
||
21 | * @throws LinkedInTransferException |
||
22 | */ |
||
23 | 5 | public static function convert(ResponseInterface $response, $requestFormat, $dataType) |
|
45 | |||
46 | /** |
||
47 | * @param ResponseInterface $response |
||
48 | * |
||
49 | * @return string |
||
50 | */ |
||
51 | 5 | public static function convertToArray(ResponseInterface $response) |
|
55 | |||
56 | /** |
||
57 | * @param ResponseInterface $response |
||
58 | * |
||
59 | * @return \SimpleXMLElement |
||
60 | * |
||
61 | * @throws LinkedInTransferException |
||
62 | */ |
||
63 | 3 | public static function convertToSimpleXml(ResponseInterface $response) |
|
72 | } |
||
73 |