diff --git a/src/Controller/HandlePdfController.php b/src/Controller/HandlePdfController.php index 03489fea80bceeae4cc7fe84de8069bdba18c953..9a3fa0cb52c84fc46b053092dbd0ef9047331d58 100644 --- a/src/Controller/HandlePdfController.php +++ b/src/Controller/HandlePdfController.php @@ -102,8 +102,7 @@ class HandlePdfController extends ControllerBase { $container->get('fillpdf.token_resolver'), $container->get('request_stack'), $container->get('plugin.manager.fillpdf_backend'), - $container->get('plugin.manager.fillpdf_action.processor'), - $container->get('entity.query') + $container->get('plugin.manager.fillpdf_action.processor') ); } diff --git a/src/Form/FillPdfAdminFormBase.php b/src/Form/FillPdfAdminFormBase.php index 45229d0b4b93e9ca93e87924421565c005b7dc8d..c7b394cddd081a04d197e6951796cd3ccf93a00e 100644 --- a/src/Form/FillPdfAdminFormBase.php +++ b/src/Form/FillPdfAdminFormBase.php @@ -4,10 +4,17 @@ namespace Drupal\fillpdf\Form; use Drupal\Core\Form\FormBase; +@trigger_error('FillPdfAdminFormBase is deprecated in fillpdf:8.x-4.7 and will be removed from fillpdf:8.x-5.0. Use \Drupal\Core\Form\FormBase instead. See https://www.drupal.org/project/fillpdf/issues/3044743', E_USER_DEPRECATED); + /** * Class FillPdfAdminFormBase. * * @package Drupal\fillpdf\Form + * + * @deprecated in fillpdf:8.x-4.7 and will be removed from fillpdf:8.x-5.0. Use + * FormBase instead. + * @see https://www.drupal.org/project/fillpdf/issues/3044743 + * @see \Drupal\Core\Form\FormBase */ abstract class FillPdfAdminFormBase extends FormBase { diff --git a/src/Form/FillPdfOverviewForm.php b/src/Form/FillPdfOverviewForm.php index 360825e41b74ef59d2c3bddfce816cbb1327a486..6aa2e653ac703e4fe927933aeda42beaff772fdc 100644 --- a/src/Form/FillPdfOverviewForm.php +++ b/src/Form/FillPdfOverviewForm.php @@ -3,11 +3,10 @@ namespace Drupal\fillpdf\Form; use Drupal\Component\Render\FormattableMarkup; -use Drupal\Core\Entity\Query\QueryFactory; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\File\FileSystemInterface; +use Drupal\Core\Form\FormBase; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Session\AccountInterface; use Drupal\Core\Url; use Drupal\file\Entity\File; use Drupal\fillpdf\FillPdfBackendManager; @@ -18,7 +17,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** * FillPDF overview form. */ -class FillPdfOverviewForm extends FillPdfAdminFormBase { +class FillPdfOverviewForm extends FormBase { /** * The module handler. @@ -34,20 +33,6 @@ class FillPdfOverviewForm extends FillPdfAdminFormBase { */ protected $backendManager; - /** - * The current user account. - * - * @var \Drupal\Core\Session\AccountInterface - */ - protected $currentUser; - - /** - * The entity query factory. - * - * @var \Drupal\Core\Entity\Query\QueryFactory - */ - protected $entityQuery; - /** * The file system. * @@ -69,22 +54,14 @@ class FillPdfOverviewForm extends FillPdfAdminFormBase { * The module handler. * @param \Drupal\fillpdf\FillPdfBackendManager $backend_manager * The FillPDF backend manager. - * @param \Drupal\Core\Session\AccountInterface $current_user - * The current user account. - * @param \Drupal\Core\Entity\Query\QueryFactory $entity_query - * The entity query factory. * @param \Drupal\Core\File\FileSystemInterface $file_system * The file system. * @param \Drupal\fillpdf\InputHelperInterface $input_helper * The FillPDF input helper. */ - public function __construct(ModuleHandlerInterface $module_handler, FillPdfBackendManager $backend_manager, AccountInterface $current_user, QueryFactory $entity_query, FileSystemInterface $file_system, InputHelperInterface $input_helper) { - parent::__construct(); - + public function __construct(ModuleHandlerInterface $module_handler, FillPdfBackendManager $backend_manager, FileSystemInterface $file_system, InputHelperInterface $input_helper) { $this->moduleHandler = $module_handler; $this->backendManager = $backend_manager; - $this->currentUser = $current_user; - $this->entityQuery = $entity_query; $this->fileSystem = $file_system; $this->inputHelper = $input_helper; } @@ -95,10 +72,7 @@ class FillPdfOverviewForm extends FillPdfAdminFormBase { public static function create(ContainerInterface $container) { return new static( $container->get('module_handler'), - // Load the plugin manager. $container->get('plugin.manager.fillpdf_backend'), - $container->get('current_user'), - $container->get('entity.query'), $container->get('file_system'), $container->get('fillpdf.input_helper') ); diff --git a/src/Service/FillPdfContextManager.php b/src/Service/FillPdfContextManager.php index af5b4d0153d563de02b6573af4224941f11f4c00..5f8f9778d22688ff66628444a72cb1a1f42748db 100644 --- a/src/Service/FillPdfContextManager.php +++ b/src/Service/FillPdfContextManager.php @@ -4,23 +4,27 @@ namespace Drupal\fillpdf\Service; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\fillpdf\FillPdfContextManagerInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; class FillPdfContextManager implements FillPdfContextManagerInterface { - /** @var EntityTypeManagerInterface $entityTypeManager */ + /** + * @var \Drupal\Core\Entity\EntityTypeManagerInterface + * + * The entity type manager. + */ protected $entityTypeManager; + /** + * Constructs FillPdfContextManager. + * + * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager + */ public function __construct(EntityTypeManagerInterface $entity_type_manager) { $this->entityTypeManager = $entity_type_manager; } - public static function create(ContainerInterface $container) { - return new static($container->get('entity.manager')); - } - /** - * {@inheritDoc} + * {@inheritdoc} */ public function loadEntities(array $context) { $entities = [];