You are here

public function OEmbedResolver::__construct in Gutenberg 8.2

OEmbedProcessor constructor.

Parameters

\Symfony\Component\DependencyInjection\ContainerInterface $container: The service container.

\GuzzleHttp\ClientInterface $client: The HTTP client.

\Drupal\Core\Render\RendererInterface $renderer: The renderer.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.

File

src/OEmbedResolver.php, line 68

Class

OEmbedResolver
Class for resolving oEmbed URLs.

Namespace

Drupal\gutenberg

Code

public function __construct(ContainerInterface $container, ClientInterface $client, RendererInterface $renderer, ModuleHandlerInterface $module_handler) {
  $this->httpClient = $client;
  $this->renderer = $renderer;
  $this->moduleHandler = $module_handler;
  if ($module_handler
    ->moduleExists('media')) {
    $this->mediaOembedResolver = $container
      ->get('media.oembed.url_resolver', ContainerInterface::NULL_ON_INVALID_REFERENCE);
    $this->mediaOembedResourceFetcher = $container
      ->get('media.oembed.resource_fetcher', ContainerInterface::NULL_ON_INVALID_REFERENCE);
  }
}