Resolve #3468898 "Entity usage autowire aliases"
Merged
requested to merge issue/entity_usage-3468898:3468898-entity-usage-autowire-aliases into 8.x-2.x
7 unresolved threads
Closes #3468898
Merge request reports
Activity
added 1 commit
- 2d20cf6b - autowire/autoconfigure/logger/containerinjection
added 1 commit
- c21c0b9f - fix event dispatcher autowiring, prefill tablename from service container...
added 1 commit
- 857df262 - add interface and trait per https://www.drupal.org/node/3395436
12 12 */ 13 13 class BatchUpdateForm extends FormBase { 14 14 15 /** 16 * The EntityUsageBatchManager service. 17 * 18 * @var \Drupal\entity_usage\EntityUsageBatchManager 19 */ 20 protected $batchManager; 21 22 15 /** 23 16 * BatchUpdateForm constructor. - Comment on lines 22 to 23
Constructor docblocks are not needed anymore. Also, let's face it, it's stupid.
From https://www.drupal.org/docs/develop/standards/php/api-documentation-and-comment-standards#classes
All classes and all of their methods (including private methods but excluding constructors) must be documented.
See also https://www.drupal.org/project/coding_standards/issues/2140961
So let's remove it
16 * The EntityUsageBatchManager service. 17 * 18 * @var \Drupal\entity_usage\EntityUsageBatchManager 19 */ 20 protected $batchManager; 21 22 15 /** 23 16 * BatchUpdateForm constructor. 24 * 25 * @param \Drupal\entity_usage\EntityUsageBatchManager $batch_manager 26 * The entity usage batch manager. 27 17 */ 28 public function __construct(EntityUsageBatchManager $batch_manager) { 29 $this->batchManager = $batch_manager; 18 final public function __construct( 19 private EntityUsageBatchManager $batchManager, 53 /** 54 * Construct the EntityUsage object. 55 * 56 * @param \Drupal\Core\Database\Connection $connection 57 * The database connection which will be used to store the entity usage 58 * information. 59 * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher 60 * An event dispatcher instance to use for events. 61 * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory 62 * The config factory. 63 * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler 64 * The ModuleHandler service. 65 * @param string $table 66 * (optional) The table to store the entity usage info. Defaults to 67 * 'entity_usage'. 19 * Construct the EntityUsage service. 66 * (optional) The table to store the entity usage info. Defaults to 67 * 'entity_usage'. 19 * Construct the EntityUsage service. 68 20 */ 69 public function __construct(Connection $connection, EventDispatcherInterface $event_dispatcher, ConfigFactoryInterface $config_factory, ModuleHandlerInterface $module_handler, $table = 'entity_usage') { 70 $this->connection = $connection; 71 $this->tableName = $table; 72 $this->eventDispatcher = $event_dispatcher; 73 $this->moduleHandler = $module_handler; 74 $this->config = $config_factory->get('entity_usage.settings'); 21 final public function __construct( 22 private Connection $connection, 23 private EventDispatcherInterface $eventDispatcher, 24 private ConfigFactoryInterface $configFactory, 25 private ModuleHandlerInterface $moduleHandler, 26 private string $tableName, Readonly properties were introduced in PHP 8.1 https://php.watch/versions/8.1/readonly
27 /** 28 * The entity type manager. 29 * 30 * @var \Drupal\Core\Entity\EntityTypeManagerInterface 31 */ 32 protected $entityTypeManager; 33 34 /** 35 * The entity usage configuration. 36 * 37 * @var \Drupal\Core\Config\Config 38 */ 39 protected $config; 40 41 28 /** 42 29 * Creates a EntityUsageBatchManager object. 30 /** 31 * The entity type manager. 32 * 33 * @var \Drupal\Core\Entity\EntityTypeManagerInterface 34 */ 35 protected $entityTypeManager; 36 37 /** 38 * The entity usage configuration. 39 * 40 * @var \Drupal\Core\Config\Config 41 */ 42 protected $config; 43 44 28 /** 45 29 * Creates a EntityUsageQueueBatchManager object. added 4 commits
Toggle commit list
Please register or sign in to reply