Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / consolidation / robo / src / Common / InputAwareTrait.php
1 <?php
2
3 namespace Robo\Common;
4
5 use Symfony\Component\Console\Input\ArgvInput;
6 use Symfony\Component\Console\Input\InputInterface;
7
8 trait InputAwareTrait
9 {
10     /**
11      * @var \Symfony\Component\Console\Input\InputInterface
12      */
13     protected $input;
14
15     /**
16      * @param \Symfony\Component\Console\Input\InputInterface $input
17      *
18      * @return $this
19      *
20      * @see \Symfony\Component\Console\Input\InputAwareInterface::setInput()
21      */
22     public function setInput(InputInterface $input)
23     {
24         $this->input = $input;
25
26         return $this;
27     }
28
29     /**
30      * @return \Symfony\Component\Console\Input\InputInterface
31      */
32     protected function input()
33     {
34         if (!isset($this->input)) {
35             $this->setInput(new ArgvInput());
36         }
37         return $this->input;
38     }
39
40     /**
41      * Backwards compatibility.
42      *
43      * @return \Symfony\Component\Console\Input\InputInterface
44      *
45      * @deprecated
46      */
47     protected function getInput()
48     {
49         return $this->input();
50     }
51 }