Skip to content

Commit

Permalink
Merge branch '2.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
andriyun committed Dec 9, 2021
2 parents 95af65c + e538c07 commit 3255630
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,32 +34,13 @@ class WebformAttachmentSbsysXml extends WebformAttachmentXml {
*/
protected $elementManager;

/**
* {@inheritdoc}
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, LoggerInterface $logger, ConfigFactoryInterface $config_factory, AccountInterface $current_user, EntityTypeManagerInterface $entity_type_manager, ElementInfoManagerInterface $element_info, WebformElementManagerInterface $element_manager, WebformTokenManagerInterface $token_manager, WebformLibrariesManagerInterface $libraries_manager) {
parent::__construct($configuration, $plugin_id, $plugin_definition, $logger, $config_factory, $current_user, $entity_type_manager, $element_info, $element_manager, $token_manager, $libraries_manager, $element_manager);
$this->elementManager = $element_manager;
}

/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static(
$configuration,
$plugin_id,
$plugin_definition,
$container->get('logger.factory')->get('webform'),
$container->get('config.factory'),
$container->get('current_user'),
$container->get('entity_type.manager'),
$container->get('plugin.manager.element_info'),
$container->get('plugin.manager.webform.element'),
$container->get('webform.token_manager'),
$container->get('webform.libraries_manager'),
$container->get('plugin.manager.webform.element')
);
$instance = parent::create($container, $configuration, $plugin_id, $plugin_definition);
$instance->elementManager = $container->get('plugin.manager.webform.element');
return $instance;
}

/**
Expand Down
29 changes: 5 additions & 24 deletions src/Plugin/WebformHandler/SaveToFileWebformHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,34 +97,15 @@ class SaveToFileWebformHandler extends WebformHandlerBase {
'metatag',
];

/**
* {@inheritdoc}
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, LoggerChannelFactoryInterface $logger_factory, ConfigFactoryInterface $config_factory, EntityTypeManagerInterface $entity_type_manager, WebformSubmissionConditionsValidatorInterface $conditions_validator, ModuleHandlerInterface $module_handler, WebformTokenManagerInterface $token_manager, WebformMessageManagerInterface $message_manager, WebformElementManagerInterface $element_manager) {
parent::__construct($configuration, $plugin_id, $plugin_definition, $logger_factory, $config_factory, $entity_type_manager, $conditions_validator);
$this->moduleHandler = $module_handler;
$this->tokenManager = $token_manager;
$this->messageManager = $message_manager;
$this->elementManager = $element_manager;
}

/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
$instance = new static(
$configuration,
$plugin_id,
$plugin_definition,
$container->get('logger.factory'),
$container->get('config.factory'),
$container->get('entity_type.manager'),
$container->get('webform_submission.conditions_validator'),
$container->get('module_handler'),
$container->get('webform.token_manager'),
$container->get('webform.message_manager'),
$container->get('plugin.manager.webform.element')
);
$instance = parent::create($container, $configuration, $plugin_id, $plugin_definition);
$instance->moduleHandler = $container->get('module_handler');
$instance->tokenManager = $container->get('webform.token_manager');
$instance->messageManager = $container->get('webform.message_manager');
$instance->elementManager = $container->get('plugin.manager.webform.element');

$instance->request = $container->get('request_stack')->getCurrentRequest();
$instance->kernel = $container->get('kernel');
Expand Down

0 comments on commit 3255630

Please sign in to comment.