diff --git a/src/Form/FillPdfSettingsForm.php b/src/Form/FillPdfSettingsForm.php index 5ee6a123221b6e8e338a8dd40588c5bae9fd2fee..8dcf656d0589dc72fc2d994fddea489502b91791 100644 --- a/src/Form/FillPdfSettingsForm.php +++ b/src/Form/FillPdfSettingsForm.php @@ -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', ]; } diff --git a/src/Plugin/FillPdfActionPluginManager.php b/src/Plugin/FillPdfActionPluginManager.php index c27deee09bd1eff77fdc0c4b284d7d8c7087ba8c..645620236e544760c4fbf19fa92bc9c1c0592187 100644 --- a/src/Plugin/FillPdfActionPluginManager.php +++ b/src/Plugin/FillPdfActionPluginManager.php @@ -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'); diff --git a/src/Plugin/PdfBackendManager.php b/src/Plugin/PdfBackendManager.php index ac369d07057b8351fc22e341917483d131a4f6d5..368087b500f02778eb4f65820f529d21e1e86845 100644 --- a/src/Plugin/PdfBackendManager.php +++ b/src/Plugin/PdfBackendManager.php @@ -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'); diff --git a/src/Serializer.php b/src/Serializer.php index 23910772240b80792e9e8c82b108a3fe8254aabc..97f6975f5248867aa3a26ed24b723101813bb0b2 100644 --- a/src/Serializer.php +++ b/src/Serializer.php @@ -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.