Essence\Provider\OEmbed::_parse PHP Method

_parse() protected method

Parses the given response depending on its format.
protected _parse ( string $response, string $format ) : array
$response string Response.
$format string Format.
return array Data.
    protected function _parse($response, $format)
    {
        switch ($format) {
            case Format::json:
                return Json::parse($response);
            case Format::xml:
                return Xml::parse($response);
            default:
                throw new Exception('Unsupported response format.');
        }
    }