Embera\Embera::getProviders PHP Method

getProviders() protected method

Finds all the valid urls inside the given text, compares which are allowed and returns an array with the detected providers
protected getProviders ( null | string | array $body = '' ) : array
$body null | string | array An array or string with Urls
return array
    protected function getProviders($body = '')
    {
        $regex = $this->config['use_embed_prefix'] === true ? $this->urlEmbedRegex : $this->urlRegex;
        if (is_array($body)) {
            $body = array_filter($body, function ($arr) use($regex) {
                return preg_match($regex, $arr);
            });
            $services = $this->providers->getAll($body);
        } elseif (preg_match_all($regex, $body, $matches)) {
            $services = $this->providers->getAll($matches['0']);
        } else {
            return array();
        }
        return $this->clean($services);
    }