diff vendor/consolidation/annotated-command/src/Input/StdinAwareTrait.php @ 4:a9cd425dd02b

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:11:55 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/consolidation/annotated-command/src/Input/StdinAwareTrait.php	Thu Feb 28 13:11:55 2019 +0000
@@ -0,0 +1,30 @@
+<?php
+
+namespace Consolidation\AnnotatedCommand\Input;
+
+/**
+ * StdinAwareTrait provides the implementation for StdinAwareInterface.
+ */
+trait StdinAwareTrait
+{
+    protected $stdinHandler;
+
+    /**
+     * @inheritdoc
+     */
+    public function setStdinHandler(StdinHandler $stdin)
+    {
+        $this->stdinHandler = $stdin;
+    }
+
+    /**
+     * @inheritdoc
+     */
+    public function stdin()
+    {
+        if (!$this->stdinHandler) {
+            $this->stdinHandler = new StdinHandler();
+        }
+        return $this->stdinHandler;
+    }
+}