|
@@ 51-53 (lines=3) @@
|
| 48 |
|
private function normalizeSearchVideosResponse($response) |
| 49 |
|
{ |
| 50 |
|
$response = json_decode($response, true); |
| 51 |
|
if (!is_array($response) || !array_key_exists('result', $response) || !array_key_exists('total', $response)) { |
| 52 |
|
throw new Exception('Invalid response from search endpoint'); |
| 53 |
|
} |
| 54 |
|
|
| 55 |
|
$response['totalCount'] = $response['total']; |
| 56 |
|
$response['videos'] = $response['result']; |
|
@@ 94-96 (lines=3) @@
|
| 91 |
|
private function normalizeSearchChannelsResponse($response) |
| 92 |
|
{ |
| 93 |
|
$response = json_decode($response, true); |
| 94 |
|
if (!is_array($response) || !array_key_exists('result', $response) || !array_key_exists('total', $response)) { |
| 95 |
|
throw new Exception('Invalid response from search endpoint'); |
| 96 |
|
} |
| 97 |
|
|
| 98 |
|
$response['totalCount'] = $response['total']; |
| 99 |
|
$response['channels'] = $response['result']; |