From bb5620b59515186d6dc65e1d3c9f2f52f61acf48 Mon Sep 17 00:00:00 2001 From: Moshe Weitzman Date: Sat, 9 Mar 2024 17:07:03 -0500 Subject: [PATCH] docs formatting --- docs/dependency-injection.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/dependency-injection.md b/docs/dependency-injection.md index cc713841ac..f825b3f839 100644 --- a/docs/dependency-injection.md +++ b/docs/dependency-injection.md @@ -9,7 +9,8 @@ Drush command files obtain references to the resources they need through a techn Autowire ------------------ -:octicons-tag-24: 13 +:octicons-tag-24: 12.5+ + Command files may inject Drush and Drupal services by adding the [AutowireTrait](https://github.com/drush-ops/drush/blob/13.x/src/Commands/AutowireTrait.php) to the class (example: [PmCommands](https://github.com/drush-ops/drush/blob/13.x/src/Commands/pm/PmCommands.php)). This enables your [Constructor parameter type hints determine the the injected service](https://www.drupal.org/node/3396179). When a type hint is insufficient, an [#[Autowire] Attribute](https://www.drupal.org/node/3396179) on the constructor property (with _service:_ named argument) directs AutoWireTrait to the right service (example: [LoginCommands](https://github.com/drush-ops/drush/blob/13.x/src/Commands/core/LoginCommands.php)). This Attribute is currently _required_ when injecting Drush services (not required for Drupal services). If your command is not found by Drush, add the `-vvv` option for debug info about any service instantiation errors. If Autowire is still insufficient, a commandfile may implement its own `create()` method (see below).