Optimize initialization of ECA-related Symfony events
Problem/Motivation
The current implementation on how ECA-related events are being instantiated might introduce some unwanted overhead and limited flexibility.
For example, the eca_content.module file declares about 30 class usages that are mostly event classes:
<?php
use Drupal\eca_content\Event\ContentEntityBundleCreate;
use Drupal\eca_content\Event\ContentEntityBundleDelete;
use Drupal\eca_content\Event\ContentEntityCreate;
use Drupal\eca_content\Event\ContentEntityDelete;
// ...
?>Proposed resolution
Create a factory service that encapsulates that loading part. It may even dynamically use the already existing plugin definitions (that are coming from the ContentEntityEventDeriver in scope of eca_content).
Edited by drupalbot