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

Issue #3272489: Remove deprecated methods

parent b52ec289
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
}
......@@ -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();
}
}
......@@ -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;
}
}
......@@ -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);
}
}
......@@ -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;
}
}
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