Skip to content

Commit

Permalink
Cleaned up object creation
Browse files Browse the repository at this point in the history
  • Loading branch information
rimi-itk committed Aug 21, 2024
1 parent d7b5b2a commit 71dac15
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,9 @@ final class WebformHandlerSF1601 extends WebformHandlerBase {
* @phpstan-param array<string, mixed> $configuration
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
$instance = new static($configuration, $plugin_id, $plugin_definition);

$instance->loggerFactory = $container->get('logger.factory');
$instance->configFactory = $container->get('config.factory');
$instance->renderer = $container->get('renderer');
$instance->entityTypeManager = $container->get('entity_type.manager');
$instance->conditionsValidator = $container->get('webform_submission.conditions_validator');
$instance->tokenManager = $container->get('webform.token_manager');
$instance->helper = $container->get(WebformHelperSF1601::class);
$instance = parent::create($container, $configuration, $plugin_id, $plugin_definition);

$instance->setConfiguration($configuration);
$instance->helper = $container->get(WebformHelperSF1601::class);

return $instance;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,6 @@ final class MaestroNotificationHandler extends WebformHandlerBase {
*/
private const NOTIFICATION_SUBJECT_MAX_LENGTH = 128;

/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
$instance = parent::create($container, $configuration, $plugin_id, $plugin_definition);

$instance->loggerFactory = $container->get('logger.factory');
$instance->configFactory = $container->get('config.factory');
$instance->renderer = $container->get('renderer');
$instance->entityTypeManager = $container->get('entity_type.manager');
$instance->conditionsValidator = $container->get('webform_submission.conditions_validator');

$instance->setConfiguration($configuration);

return $instance;
}

/**
* {@inheritdoc}
*/
Expand Down

0 comments on commit 71dac15

Please sign in to comment.