function ImageToolkitOperationBase::__construct

Same name and namespace in other branches
  1. 10 core/lib/Drupal/Core/ImageToolkit/ImageToolkitOperationBase.php \Drupal\Core\ImageToolkit\ImageToolkitOperationBase::__construct()
  2. 9 core/lib/Drupal/Core/ImageToolkit/ImageToolkitOperationBase.php \Drupal\Core\ImageToolkit\ImageToolkitOperationBase::__construct()
  3. 8.9.x core/lib/Drupal/Core/ImageToolkit/ImageToolkitOperationBase.php \Drupal\Core\ImageToolkit\ImageToolkitOperationBase::__construct()

Constructs an image toolkit operation plugin.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin ID for the plugin instance.

array $plugin_definition: The plugin implementation definition.

\Psr\Log\LoggerInterface|\Drupal\Core\ImageToolkit\ImageToolkitInterface $toolkit: (deprecated) The image toolkit.

\Psr\Log\LoggerInterface|null $logger: A logger instance.

Overrides PluginBase::__construct

1 call to ImageToolkitOperationBase::__construct()
Autowiring::__construct in core/modules/system/tests/modules/image_test/src/Plugin/ImageToolkit/Operation/test/Autowiring.php
Constructs an image toolkit operation plugin.
1 method overrides ImageToolkitOperationBase::__construct()
Autowiring::__construct in core/modules/system/tests/modules/image_test/src/Plugin/ImageToolkit/Operation/test/Autowiring.php
Constructs an image toolkit operation plugin.

File

core/lib/Drupal/Core/ImageToolkit/ImageToolkitOperationBase.php, line 45

Class

ImageToolkitOperationBase
Provides a base class for image toolkit operation plugins.

Namespace

Drupal\Core\ImageToolkit

Code

public function __construct(array $configuration, string $plugin_id, array $plugin_definition, #[Autowire(service: 'logger.channel.image')] LoggerInterface|ImageToolkitInterface $toolkit, #[Autowire(service: 'logger.channel.image')] ?LoggerInterface $logger = NULL) {
  parent::__construct($configuration, $plugin_id, $plugin_definition);
  if ($toolkit instanceof ImageToolkitInterface) {
    @trigger_error('The $toolkit argument of ' . __METHOD__ . ' is deprecated in drupal:11.4.0 and the argument is removed from drupal:13.0.0. Use ::setToolkit() instead. See https://www.drupal.org/node/3562304', E_USER_DEPRECATED);
    $this->toolkit = $toolkit;
    $this->logger = $logger;
  }
  else {
    $this->logger = $toolkit;
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.