Skip to content
Snippets Groups Projects
Commit f85a9098 authored by Liam Morland's avatar Liam Morland
Browse files

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

parent 84e2df2f
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,7 @@ use Drupal\Core\File\FileSystemInterface; ...@@ -8,6 +8,7 @@ use Drupal\Core\File\FileSystemInterface;
use Drupal\Core\Form\ConfigFormBase; use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Link; use Drupal\Core\Link;
use Drupal\Core\Render\Element\Select;
use Drupal\Core\Render\RendererInterface; use Drupal\Core\Render\RendererInterface;
use Drupal\fillpdf\Component\Utility\FillPdf; use Drupal\fillpdf\Component\Utility\FillPdf;
use Drupal\fillpdf\Entity\FillPdfForm; use Drupal\fillpdf\Entity\FillPdfForm;
...@@ -332,11 +333,11 @@ class FillPdfSettingsForm extends ConfigFormBase { ...@@ -332,11 +333,11 @@ class FillPdfSettingsForm extends ConfigFormBase {
// Remove once one of these landed. // Remove once one of these landed.
// @see https://www.drupal.org/project/drupal/issues/2854166 // @see https://www.drupal.org/project/drupal/issues/2854166
$form['shell_locale']['#process'][] = [ $form['shell_locale']['#process'][] = [
'Drupal\Core\Render\Element\Select', Select::class,
'processGroup', 'processGroup',
]; ];
$form['shell_locale']['#pre_render'][] = [ $form['shell_locale']['#pre_render'][] = [
'Drupal\Core\Render\Element\Select', Select::class,
'preRenderGroup', 'preRenderGroup',
]; ];
} }
......
...@@ -5,6 +5,7 @@ namespace Drupal\fillpdf\Plugin; ...@@ -5,6 +5,7 @@ namespace Drupal\fillpdf\Plugin;
use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Plugin\DefaultPluginManager; use Drupal\Core\Plugin\DefaultPluginManager;
use Drupal\fillpdf\Annotation\FillPdfActionPlugin;
/** /**
* Provides the FillPDF action plugin plugin manager. * Provides the FillPDF action plugin plugin manager.
...@@ -23,7 +24,7 @@ class FillPdfActionPluginManager extends DefaultPluginManager { ...@@ -23,7 +24,7 @@ class FillPdfActionPluginManager extends DefaultPluginManager {
* The module handler to invoke the alter hook with. * The module handler to invoke the alter hook with.
*/ */
public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) { 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->alterInfo('fillpdf_fillpdf_action_info');
$this->setCacheBackend($cache_backend, 'fillpdf_fillpdf_action_plugins'); $this->setCacheBackend($cache_backend, 'fillpdf_fillpdf_action_plugins');
......
...@@ -6,6 +6,7 @@ use Drupal\Component\Plugin\FallbackPluginManagerInterface; ...@@ -6,6 +6,7 @@ use Drupal\Component\Plugin\FallbackPluginManagerInterface;
use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Plugin\DefaultPluginManager; use Drupal\Core\Plugin\DefaultPluginManager;
use Drupal\fillpdf\Annotation\PdfBackend;
/** /**
* Provides the FillPDF PdfBackend plugin manager. * Provides the FillPDF PdfBackend plugin manager.
...@@ -24,7 +25,7 @@ class PdfBackendManager extends DefaultPluginManager implements FallbackPluginMa ...@@ -24,7 +25,7 @@ class PdfBackendManager extends DefaultPluginManager implements FallbackPluginMa
* The module handler to invoke the alter hook with. * The module handler to invoke the alter hook with.
*/ */
public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) { 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->alterInfo('fillpdf_pdfbackend_info');
$this->setCacheBackend($cache_backend, 'fillpdf_pdfbackend_plugins'); $this->setCacheBackend($cache_backend, 'fillpdf_pdfbackend_plugins');
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
namespace Drupal\fillpdf; namespace Drupal\fillpdf;
use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\fillpdf\Entity\FillPdfForm;
use Drupal\fillpdf\Entity\FillPdfFormField;
use Symfony\Component\Serializer\Serializer as SymfonySerializer; use Symfony\Component\Serializer\Serializer as SymfonySerializer;
/** /**
...@@ -59,7 +61,7 @@ class Serializer implements SerializerInterface { ...@@ -59,7 +61,7 @@ class Serializer implements SerializerInterface {
*/ */
public function deserializeForm($code) { public function deserializeForm($code) {
$mappings_raw = json_decode($code, TRUE); $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 // Denormalization is a pain; we have to iterate over the fields to actually
// recompose the $fields array. // recompose the $fields array.
...@@ -67,7 +69,7 @@ class Serializer implements SerializerInterface { ...@@ -67,7 +69,7 @@ class Serializer implements SerializerInterface {
$decoded_fields = []; $decoded_fields = [];
foreach ($field_json as $normalized_field) { 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 // @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, // not using the array keys to remain compatible with previous exports,
// but should do so that at some later point. // but should do so that at some later point.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment