Improvements from Jurgen

Created on 16 June 2025, 16 days ago

Hey Carlos,

I haven't checked all details in the code, but it looks pretty solid overall.
7:45
Just one thing that I spotted that you could improve. Your create functions in action plugins look like this:
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition): static {
$instance = new static(
$configuration,
$plugin_id,
$plugin_definition,
$container->get('entity_type.manager'),
$container->get('eca.token_services'),
$container->get('current_user'),
$container->get('datetime.time'),
$container->get('eca.state'),
$container->get('logger.channel.eca')
);

// Inject the Salesforce client service.
$instance->setSalesforceClient($container->get('salesforce.client'));

return $instance;
}
That's problematic as you have to keep each of those updated, if anything in ECA's base class changes. You can change this to something much easier though:
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition): static {
$instance = parent::create(
$configuration,
$plugin_id,
$plugin_definition,
);

// Inject the Salesforce client service.
$instance->setSalesforceClient($container->get('salesforce.client'));

return $instance;
}
That will always work and you never have to bother about it anymore.

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States camoa

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024