Patched to Drupal 8.4.8 level. See https://www.drupal.org/sa-core-2018-004 and patch...
[yaffs-website] / vendor / drupal / console-core / src / Command / Command.php
1 <?php
2
3 /**
4  * @file
5  * Contains \Drupal\Console\Core\Command\Command.
6  */
7
8 namespace Drupal\Console\Core\Command;
9
10 use Symfony\Component\Console\Command\Command as BaseCommand;
11 use Symfony\Component\Console\Input\InputInterface;
12 use Symfony\Component\Console\Output\OutputInterface;
13 use Drupal\Console\Core\Command\Shared\CommandTrait;
14 use Drupal\Console\Core\Style\DrupalStyle;
15
16 /**
17  * Class Command
18  *
19  * @package Drupal\Console\Core\Command
20  */
21 abstract class Command extends BaseCommand
22 {
23     use CommandTrait;
24
25     /**
26      * @var DrupalStyle
27      */
28     private $io;
29
30     /**
31      * {@inheritdoc}
32      */
33     protected function initialize(InputInterface $input, OutputInterface $output)
34     {
35         $this->io = new DrupalStyle($input, $output);
36     }
37
38     /**
39      * @return \Drupal\Console\Core\Style\DrupalStyle
40      */
41     public function getIo()
42     {
43         return $this->io;
44     }
45 }