diff --git a/src/Component/Helper/FillPdfMappingHelper.php b/src/Component/Helper/FillPdfMappingHelper.php index d1fd27474cfebb270f40355a02f5c192e5ebd898..59028cd868047bc62408db981755a1c0a59b7975 100644 --- a/src/Component/Helper/FillPdfMappingHelper.php +++ b/src/Component/Helper/FillPdfMappingHelper.php @@ -43,28 +43,4 @@ class FillPdfMappingHelper implements FillPdfMappingHelperInterface { } } - /** - * Applies form and field level replacements to a string. - * - * @param string $value - * The value to replace. Must match the key in a replacements field exactly. - * @param array $form_replacements - * A list of form-level replacements. - * @param array $field_replacements - * A list of field-level replacements. These have precedence. - * - * @return string - * $value with any matching replacements applied. - * - * @deprecated in fillpdf:8.x-4.7 and is removed from fillpdf:8.x-5.0. - * Deprecated in core. - * @see https://www.drupal.org/project/fillpdf/issues/3044743 - */ - public static function transformString($value, array $form_replacements, array $field_replacements) { - @trigger_error('transformString is deprecated in fillpdf:8.x-4.7 and is removed from fillpdf:8.x-5.0. Deprecated in core. See https://www.drupal.org/project/fillpdf/issues/3044743', E_USER_DEPRECATED); - // Merge both with field-level replacements taking precedence. - $replacements = array_merge($form_replacements, $field_replacements); - return $replacements[$value] ?? $value; - } - } diff --git a/src/InputHelper.php b/src/InputHelper.php index 7918654dd96b2d7bbe4517e48106abff19b17929..6b2701566af358a17d854b1be85e486726259225 100644 --- a/src/InputHelper.php +++ b/src/InputHelper.php @@ -123,21 +123,4 @@ class InputHelper implements InputHelperInterface { return $form_fields; } - /** - * Saves an uploaded file, marking it permanent. - * - * @param \Drupal\file\FileInterface $file - * The file object to save. - * - * @deprecated in fillpdf:8.x-4.7 and is removed from fillpdf:8.x-5.0. - * Use FileInterface::setPermanent() and FileInterface::save() instead. - * @see https://www.drupal.org/project/fillpdf/issues/3055123 - * @see \Drupal\file\FileInterface - */ - protected function saveFileUpload(FileInterface $file) { - @trigger_error('InputHelper::saveFileUpload() is deprecated in fillpdf:8.x-4.7 and is removed from fillpdf:8.x-5.0. Use \Drupal\file\FileInterface::setPermanent() and \Drupal\file\FileInterface::save() instead. See https://www.drupal.org/project/fillpdf/issues/3055123', E_USER_DEPRECATED); - $file->setPermanent(); - $file->save(); - } - } diff --git a/src/Plugin/FillPdfActionPluginBase.php b/src/Plugin/FillPdfActionPluginBase.php index 18ee104e2a09d5d391672fbab2431ce5a867570f..cf3d56097c256dcf974be8edc7197b3528a4bf34 100644 --- a/src/Plugin/FillPdfActionPluginBase.php +++ b/src/Plugin/FillPdfActionPluginBase.php @@ -24,66 +24,4 @@ abstract class FillPdfActionPluginBase extends PluginBase implements FillPdfActi return []; } - /** - * Gets this plugin's configuration. - * - * @return array - * An array of this plugin's configuration. - * - * @todo Remove superfluous docs once drupal:8.6.x is no longer supported. - * @deprecated in fillpdf:8.x-4.8 and is removed from fillpdf:8.x-5.0. Custom - * FillPdfActionPlugins may implement ConfigurableInterface instead. - * @see https://www.drupal.org/project/fillpdf/issues/3058862 - * @see \Drupal\Component\Plugin\ConfigurableInterface::getConfiguration() - */ - public function getConfiguration() { - @trigger_error('FillPdfActionPluginInterface::getConfiguration() is deprecated in fillpdf:8.x-4.8 and is removed from fillpdf:8.x-5.0. Custom FillPdfActionPlugins may extend ConfigurableInterface instead. See https://www.drupal.org/project/fillpdf/issues/3058862', E_USER_DEPRECATED); - return $this->configuration; - } - - /** - * Sets the configuration for this plugin instance. - * - * @param array $configuration - * An associative array containing the plugin's configuration. - * - * @todo Remove superfluous docs once drupal:8.6.x is no longer supported. - * @deprecated in fillpdf:8.x-4.8 and is removed from fillpdf:8.x-5.0. Custom - * FillPdfActionPlugins may implement ConfigurableInterface instead. - * @see https://www.drupal.org/project/fillpdf/issues/3058862 - * @see \Drupal\Component\Plugin\ConfigurableInterface::setConfiguration() - */ - public function setConfiguration(array $configuration) { - @trigger_error('FillPdfActionPluginInterface::setConfiguration() is deprecated in fillpdf:8.x-4.8 and is removed from fillpdf:8.x-5.0. Custom FillPdfActionPlugins may extend ConfigurableInterface instead. See https://www.drupal.org/project/fillpdf/issues/3058862', E_USER_DEPRECATED); - $this->configuration = $configuration; - } - - /** - * Gets default configuration for this plugin. - * - * @return array - * An associative array with the default configuration. - * - * @todo Remove superfluous docs once drupal:8.6.x is no longer supported. - * @deprecated in fillpdf:8.x-4.8 and is removed from fillpdf:8.x-5.0. Custom - * FillPdfActionPlugins may implement ConfigurableInterface instead. - * @see https://www.drupal.org/project/fillpdf/issues/3058862 - * @see \Drupal\Component\Plugin\ConfigurableInterface::defaultConfiguration() - */ - public function defaultConfiguration() { - @trigger_error('FillPdfActionPluginInterface::defaultConfiguration() is deprecated in fillpdf:8.x-4.8 and is removed from fillpdf:8.x-5.0. Custom FillPdfActionPlugins may extend ConfigurableInterface instead. See https://www.drupal.org/project/fillpdf/issues/3058862', E_USER_DEPRECATED); - return []; - } - - /** - * {@inheritdoc} - * - * @todo Remove once drupal:8.6.x is no longer supported. - * @see https://www.drupal.org/project/fillpdf/issues/3058862 - */ - public function isConfigurable() { - @trigger_error('FillPdfActionPluginBase::isConfigurable() is deprecated in fillpdf:8.x-4.8 and is removed from fillpdf:8.x-5.0. Custom FillPdfActionPlugins may extend ConfigurableInterface instead. See https://www.drupal.org/project/fillpdf/issues/3058862', E_USER_DEPRECATED); - return TRUE; - } - } diff --git a/src/Serializer.php b/src/Serializer.php index 6538b7ab1a52a286b39a5b7b3add72af20aa4a38..23910772240b80792e9e8c82b108a3fe8254aabc 100644 --- a/src/Serializer.php +++ b/src/Serializer.php @@ -125,30 +125,4 @@ class Serializer implements SerializerInterface { return $unmatched_pdf_keys; } - /** - * Overwrites empty new field values with previous existing values. - * - * @param \Drupal\fillpdf\FillPdfFormFieldInterface[] $form_fields - * Associative array of saved FillPdfFormField objects keyed by entity ID. - * @param string[] $existing_fields - * (optional) Array of existing PDF keys. - * - * @return string[] - * Array of unmatched PDF keys. - * - * @deprecated in fillpdf:8.x-4.7 and is removed from fillpdf:8.x-5.0. - * Field lists are already keyed by pdf_key now, so rekeying them is - * unnecessary. Use ::importFormFields instead. - * @see https://www.drupal.org/project/fillpdf/issues/3055097 - * @see \Drupal\fillpdf\SerializerInterface::importFormFields() - */ - public function importFormFieldsByKey(array $form_fields, array $existing_fields = []) { - @trigger_error('SerializerInterface::importFormFieldsByKey() is deprecated in fillpdf:8.x-4.7 and is removed from fillpdf:8.x-5.0. Use \Drupal\fillpdf\SerializerInterface::importFormFields() instead. See https://www.drupal.org/project/fillpdf/issues/3055097', E_USER_DEPRECATED); - $keyed_fields = []; - foreach ($form_fields as $form_field) { - $keyed_fields[$form_field->pdf_key->value] = $form_field; - } - return $this->importFormFields($keyed_fields, $existing_fields); - } - } diff --git a/src/Service/FillPdfAdminFormHelper.php b/src/Service/FillPdfAdminFormHelper.php index 7859d03482a07072b8cd6200391bc80030bfb5fa..98c37ea23a95c06b7893fa6279f794c2a2264420 100644 --- a/src/Service/FillPdfAdminFormHelper.php +++ b/src/Service/FillPdfAdminFormHelper.php @@ -119,27 +119,4 @@ class FillPdfAdminFormHelper implements FillPdfAdminFormHelperInterface { with a blank, essentially erasing it.</p>"); } - /** - * Returns the configured path to the local pdftk installation. - * - * @return string - * The configured path to the local pdftk installation. - * - * @deprecated in fillpdf:8.x-4.9 and is removed from fillpdf:8.x-5.0. Use the - * PdfBackend plugin's own methods. - * - * @see https://www.drupal.org/node/3060086 - * @see \Drupal\fillpdf\Plugin\PdfBackend\PdftkPdfBackend - */ - public function getPdftkPath() { - $path_to_pdftk = $this->configFactory->get('fillpdf.settings') - ->get('pdftk_path'); - - if (empty($path_to_pdftk)) { - $path_to_pdftk = 'pdftk'; - return $path_to_pdftk; - } - return $path_to_pdftk; - } - }