mpratt / Embera

A Oembed consumer library, that gives you information about urls. It helps you replace urls to youtube or vimeo for example, with their html embed code. It has advanced features like offline support, responsive embeds and caching support.
MIT License
335 stars 59 forks source link

Argument 2 passed to Embera\Http\OembedClient::__construct() must be an instance of Embera\Http\HttpClient, instance of Embera\Http\HttpClientCache given #67

Closed vensires closed 4 years ago

vensires commented 4 years ago

Following the guidelines at https://github.com/mpratt/Embera/blob/master/doc/06-caching.md I configured my temporary directory but I couldn't request anything due to the error: "Argument 2 passed to Embera\Http\OembedClient::__construct() must be an instance of Embera\Http\HttpClient, instance of Embera\Http\HttpClientCache given".

The problem rises from the fact that HttpClientCache correctly implements HttpClientInterface but OEmbedClient's constructor checks on HttpClient and not its interface.

mpratt commented 4 years ago

Thanks for the bug report! I'll be uploading the correction in a couple of hours.

vensires commented 4 years ago

Great! Thank you!

I recently discovered your library and since I required it in 2 projects so far, I took the chance and created a Drupal module which mostly creates a composer.json dependency to your library and also provides a Drupal service to make things easier for developers.

You may see it at https://www.drupal.org/project/embera and update me if you have any issues I should take into account.

mpratt commented 4 years ago

@vensires nice work! I took a quick look and it looks good to me. I dont use Drupal that much, however I might look into putting an "Unofficial Modules" section in the README linking to your module. :+1: