Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / consolidation / robo / src / Common / InputAwareTrait.php
diff --git a/vendor/consolidation/robo/src/Common/InputAwareTrait.php b/vendor/consolidation/robo/src/Common/InputAwareTrait.php
new file mode 100644 (file)
index 0000000..bae58c1
--- /dev/null
@@ -0,0 +1,51 @@
+<?php
+
+namespace Robo\Common;
+
+use Symfony\Component\Console\Input\ArgvInput;
+use Symfony\Component\Console\Input\InputInterface;
+
+trait InputAwareTrait
+{
+    /**
+     * @var \Symfony\Component\Console\Input\InputInterface
+     */
+    protected $input;
+
+    /**
+     * @param \Symfony\Component\Console\Input\InputInterface $input
+     *
+     * @return $this
+     *
+     * @see \Symfony\Component\Console\Input\InputAwareInterface::setInput()
+     */
+    public function setInput(InputInterface $input)
+    {
+        $this->input = $input;
+
+        return $this;
+    }
+
+    /**
+     * @return \Symfony\Component\Console\Input\InputInterface
+     */
+    protected function input()
+    {
+        if (!isset($this->input)) {
+            $this->setInput(new ArgvInput());
+        }
+        return $this->input;
+    }
+
+    /**
+     * Backwards compatibility.
+     *
+     * @return \Symfony\Component\Console\Input\InputInterface
+     *
+     * @deprecated
+     */
+    protected function getInput()
+    {
+        return $this->input();
+    }
+}