diff --git a/src/Plugin/FillPdfActionPlugin/FillPdfSaveAction.php b/src/Plugin/FillPdfActionPlugin/FillPdfSaveAction.php index 280a0607496de841a3318fd254d8d33838464f70..fa91c7303728cbe70e06a202244804af278aa6cd 100644 --- a/src/Plugin/FillPdfActionPlugin/FillPdfSaveAction.php +++ b/src/Plugin/FillPdfActionPlugin/FillPdfSaveAction.php @@ -20,28 +20,24 @@ use Symfony\Component\HttpFoundation\RedirectResponse; */ class FillPdfSaveAction extends FillPdfActionPluginBase { - /** - * The FillPdf output handler. - * - * @var \Drupal\fillpdf\OutputHandler - */ - protected $outputHandler; - /** * Constructs a \Drupal\Component\Plugin\PluginBase object. * - * @param \Drupal\fillpdf\OutputHandler $output_handler - * The FillPdf output handler. * @param array $configuration * A configuration array containing information about the plugin instance. * @param string $plugin_id * The plugin_id for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. + * @param \Drupal\fillpdf\OutputHandler $outputHandler + * The fillpdf.output_handler service. */ - public function __construct(OutputHandler $output_handler, array $configuration, $plugin_id, $plugin_definition) { - $this->outputHandler = $output_handler; - + public function __construct( + array $configuration, + $plugin_id, + $plugin_definition, + protected OutputHandler $outputHandler, + ) { parent::__construct($configuration, $plugin_id, $plugin_definition); } @@ -50,10 +46,10 @@ class FillPdfSaveAction extends FillPdfActionPluginBase { */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { return new static( - $container->get('fillpdf.output_handler'), $configuration, $plugin_id, - $plugin_definition + $plugin_definition, + $container->get('fillpdf.output_handler'), ); } diff --git a/src/Plugin/PdfBackend/LocalServerPdfBackend.php b/src/Plugin/PdfBackend/LocalServerPdfBackend.php index 1a2902d24d229c18c7692191ead575c588278e0d..f166dd758d6fbda108dc7c0ca64b3d8cc823561e 100644 --- a/src/Plugin/PdfBackend/LocalServerPdfBackend.php +++ b/src/Plugin/PdfBackend/LocalServerPdfBackend.php @@ -32,13 +32,6 @@ class LocalServerPdfBackend extends PdfBackendBase implements ContainerFactoryPl */ protected $fileSystem; - /** - * The Guzzle http client. - * - * @var \GuzzleHttp\Client - */ - protected $httpClient; - /** * Constructs a LocalServerPdfBackend plugin object. * @@ -48,12 +41,16 @@ class LocalServerPdfBackend extends PdfBackendBase implements ContainerFactoryPl * The plugin_id for the plugin instance. * @param array $plugin_definition * The plugin implementation definition. - * @param \GuzzleHttp\Client $http_client + * @param \GuzzleHttp\Client $httpClient * The Guzzle http client. */ - public function __construct(array $configuration, $plugin_id, array $plugin_definition, Client $http_client) { + public function __construct( + array $configuration, + $plugin_id, + array $plugin_definition, + protected Client $httpClient, + ) { parent::__construct($configuration, $plugin_id, $plugin_definition); - $this->httpClient = $http_client; } /** diff --git a/src/Plugin/PdfBackend/PdftkPdfBackend.php b/src/Plugin/PdfBackend/PdftkPdfBackend.php index a3c401ee1a26fc33b49c0d773a4ad91e51bfcc1c..b28f251ac9643e2089e627189ee52b0a2bb98cc0 100644 --- a/src/Plugin/PdfBackend/PdftkPdfBackend.php +++ b/src/Plugin/PdfBackend/PdftkPdfBackend.php @@ -32,27 +32,6 @@ use Symfony\Component\DependencyInjection\ContainerInterface; */ class PdftkPdfBackend extends PdfBackendBase implements ContainerFactoryPluginInterface { - /** - * The file system. - * - * @var \Drupal\Core\File\FileSystemInterface - */ - protected $fileSystem; - - /** - * The FillPDF shell manager. - * - * @var \Drupal\fillpdf\ShellManager - */ - protected $shellManager; - - /** - * The entity type manager. - * - * @var \Drupal\Core\Entity\EntityTypeManagerInterface - */ - protected $entityTypeManager; - /** * Constructs a PdftkPdfBackend plugin object. * @@ -62,18 +41,22 @@ class PdftkPdfBackend extends PdfBackendBase implements ContainerFactoryPluginIn * The plugin_id for the plugin instance. * @param array $plugin_definition * The plugin implementation definition. - * @param \Drupal\Core\File\FileSystemInterface $file_system + * @param \Drupal\Core\File\FileSystemInterface $fileSystem * The file system. - * @param \Drupal\fillpdf\ShellManager $shell_manager + * @param \Drupal\fillpdf\ShellManager $shellManager * The FillPDF shell manager. - * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager + * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager * The entity type manager. */ - public function __construct(array $configuration, $plugin_id, array $plugin_definition, FileSystemInterface $file_system, ShellManager $shell_manager, EntityTypeManagerInterface $entity_type_manager) { + public function __construct( + array $configuration, + $plugin_id, + array $plugin_definition, + protected FileSystemInterface $fileSystem, + protected ShellManager $shellManager, + protected EntityTypeManagerInterface $entityTypeManager, + ) { parent::__construct($configuration, $plugin_id, $plugin_definition); - $this->fileSystem = $file_system; - $this->shellManager = $shell_manager; - $this->entityTypeManager = $entity_type_manager; } /** diff --git a/tests/modules/fillpdf_test/src/Plugin/PdfBackend/TestPdfBackend.php b/tests/modules/fillpdf_test/src/Plugin/PdfBackend/TestPdfBackend.php index 4cb40113731a3a65cd337d008666b0a9a8f7739b..4080623d552c88e47a5eac1f357d97848b321211 100644 --- a/tests/modules/fillpdf_test/src/Plugin/PdfBackend/TestPdfBackend.php +++ b/tests/modules/fillpdf_test/src/Plugin/PdfBackend/TestPdfBackend.php @@ -25,13 +25,6 @@ class TestPdfBackend extends PdfBackendBase implements ContainerFactoryPluginInt */ protected $configuration; - /** - * The state. - * - * @var \Drupal\Core\State\StateInterface - */ - protected $state; - /** * Constructs a LocalFillPdfBackend plugin object. * @@ -44,9 +37,13 @@ class TestPdfBackend extends PdfBackendBase implements ContainerFactoryPluginInt * @param \Drupal\Core\State\StateInterface $state * The state. */ - public function __construct(array $configuration, $plugin_id, array $plugin_definition, StateInterface $state) { + public function __construct( + array $configuration, + $plugin_id, + array $plugin_definition, + protected StateInterface $state, + ) { parent::__construct($configuration, $plugin_id, $plugin_definition); - $this->state = $state; } /**