From 437dc9a4e29b86f4047379033bb42226741ef8dc Mon Sep 17 00:00:00 2001 From: Liam Morland <lkmorlan@uwaterloo.ca> Date: Wed, 30 Mar 2022 11:34:30 -0400 Subject: [PATCH] Issue #3272489: Remove deprecated interface FillPdfBackendPluginInterface --- src/FillPdfBackendPluginInterface.php | 67 --------------------------- src/Service/BackendProxy.php | 2 +- 2 files changed, 1 insertion(+), 68 deletions(-) delete mode 100644 src/FillPdfBackendPluginInterface.php diff --git a/src/FillPdfBackendPluginInterface.php b/src/FillPdfBackendPluginInterface.php deleted file mode 100644 index c8a6bba..0000000 --- a/src/FillPdfBackendPluginInterface.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php - -namespace Drupal\fillpdf; - -/** - * Defines the required interface for all FillPDF BackendService plugins. - * - * @package Drupal\fillpdf - * - * @deprecated in fillpdf:8.x-4.9 and is removed from fillpdf:8.x-5.0. - * Instead of implementing FillPdfBackendPluginInterface, you should extend - * PdfBackendBase. - * @see https://www.drupal.org/node/3059476 - * @see \Drupal\fillpdf\Plugin\PdfBackendBase - */ -interface FillPdfBackendPluginInterface { - - /** - * Parse a PDF and return a list of its fields. - * - * @param \Drupal\fillpdf\FillPdfFormInterface $fillpdf_form - * The PDF whose fields are going to be parsed. - * - * @return array - * An array of associative arrays. Each sub-array contains a 'name' key with - * the name of the field and a 'type' key with the type. These can be - * iterated over and saved by the caller. - */ - public function parse(FillPdfFormInterface $fillpdf_form); - - /** - * Populate a FillPDF form with field data. - * - * Formerly known as merging. Accept an array of PDF field keys and field - * values and populate the PDF using them. - * - * @param \Drupal\fillpdf\FillPdfFormInterface $fillpdf_form - * The FillPdfForm referencing the file whose field values are going to be - * populated. - * @param array $field_mapping - * An array of fields mapping PDF field keys to the values with which they - * should be replaced. Example array: - * @code - * [ - * 'values' => [ - * 'Field 1' => 'value', - * 'Checkbox Field' => 'On', - * ], - * 'images' => [ - * 'Image Field 1' => [ - * 'data' => base64_encode($file_data), - * 'filenamehash' => md5($image_path_info['filename']) . '.' . $image_path_info['extension'], - * ], - * ], - * ] - * @endcode - * @param array $context - * The request context as returned by - * FillPdfLinkManipulatorInterface::parseLink(). - * - * @return string|null - * The raw file contents of the new PDF, or NULL if populating failed. The - * caller has to handle saving or serving the file accordingly. - */ - public function populateWithFieldData(FillPdfFormInterface $fillpdf_form, array $field_mapping, array $context); - -} diff --git a/src/Service/BackendProxy.php b/src/Service/BackendProxy.php index d924b99..0c27fb8 100644 --- a/src/Service/BackendProxy.php +++ b/src/Service/BackendProxy.php @@ -104,7 +104,7 @@ class BackendProxy implements BackendProxyInterface { } // Now load the backend plugin. - /** @var \Drupal\fillpdf\FillPdfBackendPluginInterface|\Drupal\fillpdf\Plugin\PdfBackendInterface $backend */ + /** @var \Drupal\fillpdf\Plugin\PdfBackendInterface $backend */ $backend = $this->backendManager->createInstance($config->get('backend'), $config->get()); // @todo Emit event (or call alter hook?) before populating PDF. -- GitLab