Skip to content

Commit

Permalink
Merge pull request #128 from itk-dev/feature/cleanup
Browse files Browse the repository at this point in the history
Cleaned up object creation
  • Loading branch information
rimi-itk authored Aug 21, 2024
2 parents d7b5b2a + 49c6551 commit 4fe719d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 28 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 @@ -6,7 +6,6 @@
use Drupal\Core\Link;
use Drupal\os2forms_forloeb\MaestroHelper;
use Drupal\webform\Plugin\WebformHandlerBase;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
* Maestro notification handler.
Expand Down Expand Up @@ -45,23 +44,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 4fe719d

Please sign in to comment.