Commit f85a9098 authored by Liam Morland's avatar Liam Morland
Browse files

Issue #3139382: Use ::class to refer to class names

parent 84e2df2f
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ use Drupal\Core\File\FileSystemInterface;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Link;
use Drupal\Core\Render\Element\Select;
use Drupal\Core\Render\RendererInterface;
use Drupal\fillpdf\Component\Utility\FillPdf;
use Drupal\fillpdf\Entity\FillPdfForm;
@@ -332,11 +333,11 @@ class FillPdfSettingsForm extends ConfigFormBase {
      // Remove once one of these landed.
      // @see https://www.drupal.org/project/drupal/issues/2854166
      $form['shell_locale']['#process'][] = [
        'Drupal\Core\Render\Element\Select',
        Select::class,
        'processGroup',
      ];
      $form['shell_locale']['#pre_render'][] = [
        'Drupal\Core\Render\Element\Select',
        Select::class,
        'preRenderGroup',
      ];
    }
+2 −1
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ namespace Drupal\fillpdf\Plugin;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Plugin\DefaultPluginManager;
use Drupal\fillpdf\Annotation\FillPdfActionPlugin;

/**
 * Provides the FillPDF action plugin plugin manager.
@@ -23,7 +24,7 @@ class FillPdfActionPluginManager extends DefaultPluginManager {
   *   The module handler to invoke the alter hook with.
   */
  public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
    parent::__construct('Plugin/FillPdfActionPlugin', $namespaces, $module_handler, 'Drupal\fillpdf\Plugin\FillPdfActionPluginInterface', 'Drupal\fillpdf\Annotation\FillPdfActionPlugin');
    parent::__construct('Plugin/FillPdfActionPlugin', $namespaces, $module_handler, FillPdfActionPluginInterface::class, FillPdfActionPlugin::class);

    $this->alterInfo('fillpdf_fillpdf_action_info');
    $this->setCacheBackend($cache_backend, 'fillpdf_fillpdf_action_plugins');
+2 −1
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ use Drupal\Component\Plugin\FallbackPluginManagerInterface;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Plugin\DefaultPluginManager;
use Drupal\fillpdf\Annotation\PdfBackend;

/**
 * Provides the FillPDF PdfBackend plugin manager.
@@ -24,7 +25,7 @@ class PdfBackendManager extends DefaultPluginManager implements FallbackPluginMa
   *   The module handler to invoke the alter hook with.
   */
  public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
    parent::__construct('Plugin/PdfBackend', $namespaces, $module_handler, 'Drupal\fillpdf\Plugin\PdfBackendInterface', 'Drupal\fillpdf\Annotation\PdfBackend');
    parent::__construct('Plugin/PdfBackend', $namespaces, $module_handler, PdfBackendInterface::class, PdfBackend::class);

    $this->alterInfo('fillpdf_pdfbackend_info');
    $this->setCacheBackend($cache_backend, 'fillpdf_pdfbackend_plugins');
+4 −2
Original line number Diff line number Diff line
@@ -3,6 +3,8 @@
namespace Drupal\fillpdf;

use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\fillpdf\Entity\FillPdfForm;
use Drupal\fillpdf\Entity\FillPdfFormField;
use Symfony\Component\Serializer\Serializer as SymfonySerializer;

/**
@@ -59,7 +61,7 @@ class Serializer implements SerializerInterface {
   */
  public function deserializeForm($code) {
    $mappings_raw = json_decode($code, TRUE);
    $decoded_fillpdf_form = $this->serializer->denormalize($mappings_raw['form'], 'Drupal\fillpdf\Entity\FillPdfForm');
    $decoded_fillpdf_form = $this->serializer->denormalize($mappings_raw['form'], FillPdfForm::class);

    // Denormalization is a pain; we have to iterate over the fields to actually
    // recompose the $fields array.
@@ -67,7 +69,7 @@ class Serializer implements SerializerInterface {
    $decoded_fields = [];

    foreach ($field_json as $normalized_field) {
      $field = $this->serializer->denormalize($normalized_field, 'Drupal\fillpdf\Entity\FillPdfFormField');
      $field = $this->serializer->denormalize($normalized_field, FillPdfFormField::class);
      // @todo Exported fields are now already keyed by PDF key. For now, we're
      // not using the array keys to remain compatible with previous exports,
      // but should do so that at some later point.