You are here

public static function AllowedHtmlManager::create in Markdown 8.2

Instantiates a new instance of this class.

This is a factory method that returns a new instance of this class. The factory should pass any needed dependencies into the constructor of this class, but not the container itself. Every call to this method must return a new instance of this class; that is, it may not implement a singleton.

Parameters

\Symfony\Component\DependencyInjection\ContainerInterface $container: The service container this instance should use.

Overrides ContainerInjectionInterface::create

1 call to AllowedHtmlManager::create()
ParserConfigurationForm::buildRenderStrategy in src/Form/ParserConfigurationForm.php
Builds the render strategy for a specific parser.

File

src/PluginManager/AllowedHtmlManager.php, line 96

Class

AllowedHtmlManager
Markdown Allowed HTML Plugin Manager.

Namespace

Drupal\markdown\PluginManager

Code

public static function create(ContainerInterface $container = NULL) {
  if (!$container) {
    $container = \Drupal::getContainer();
  }
  $instance = new static($container
    ->get('container.namespaces'), $container
    ->get('cache.discovery'), $container
    ->get('config.factory'), $container
    ->get('logger.channel.markdown'), $container
    ->get('module_handler'), $container
    ->get('plugin.manager.filter'), $container
    ->get('theme_handler'), $container
    ->get('theme.manager'), $container
    ->get('plugin.manager.markdown.parser'), $container
    ->get('plugin.manager.markdown.extension'));
  $instance
    ->setContainer($container);
  return $instance;
}