Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / drush / drush / tests / resources / modules / d8 / woot / src / WootCommandInfoAlterer.php
diff --git a/vendor/drush/drush/tests/resources/modules/d8/woot/src/WootCommandInfoAlterer.php b/vendor/drush/drush/tests/resources/modules/d8/woot/src/WootCommandInfoAlterer.php
new file mode 100644 (file)
index 0000000..276340d
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+
+namespace Drupal\woot;
+
+use Consolidation\AnnotatedCommand\CommandInfoAltererInterface;
+use Consolidation\AnnotatedCommand\Parser\CommandInfo;
+use Drupal\Core\Logger\LoggerChannelFactoryInterface;
+
+class WootCommandInfoAlterer implements CommandInfoAltererInterface
+{
+    /**
+     * @var \Drupal\Core\Logger\LoggerChannelInterface
+     */
+    protected $logger;
+
+    public function __construct(LoggerChannelFactoryInterface $loggerFactory)
+    {
+        $this->logger = $loggerFactory->get('drush');
+    }
+
+    public function alterCommandInfo(CommandInfo $commandInfo, $commandFileInstance)
+    {
+        if ($commandInfo->getName() === 'woot:altered') {
+            $commandInfo->setAliases('woot-new-alias');
+            $this->logger->debug(dt("Module 'woot' changed the alias of 'woot:altered' command into 'woot-new-alias' in " . __METHOD__ . '().'));
+        }
+    }
+}