{% import '@lib/di.twig' as di %}
<?php

declare(strict_types=1);

namespace Drupal\{{ machine_name }}\Plugin\migrate\process;

{% apply sort_namespaces %}
use Drupal\migrate\MigrateExecutableInterface;
use Drupal\migrate\ProcessPluginBase;
use Drupal\migrate\Row;
  {% if services %}
{{ di.use(services) }}
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
  {% endif %}
{% endapply %}

/**
 * Provides {{ plugin_id|article }} plugin.
 *
 * Usage:
 *
 * @code
 * process:
 *   bar:
 *     plugin: {{ plugin_id }}
 *     source: foo
 * @endcode
 *
 * @MigrateProcessPlugin(id = "{{ plugin_id }}")
 */
final class {{ class }} extends ProcessPluginBase {% if services %}implements ContainerFactoryPluginInterface {% endif %}{

{% if services %}
  /**
   * Constructs the plugin instance.
   */
  public function __construct(
    array $configuration,
    $plugin_id,
    $plugin_definition,
{{ di.signature(services) }}
  ) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition): self {
    return new self(
      $configuration,
      $plugin_id,
      $plugin_definition,
{{ di.container(services) }}
    );
  }

{% endif %}
  /**
   * {@inheritdoc}
   */
  public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property): mixed {
    // @todo Transform the value here.
    return $value;
  }

}
