*/ public function decode(string $json): array { try { $decoded = json_decode($json, true, 512, JSON_THROW_ON_ERROR); } catch (JsonException $exception) { throw new DecodingException('Unable to decode JSON response.', 0, $exception); } if (!is_array($decoded)) { throw new DecodingException('Decoded JSON response must be an array.'); } return $decoded; } }