Added the Search API Synonym module to deal specifically with licence and license...
[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 use Drupal\Console\Core\Utils\DrupalFinder;
16
17 /**
18  * Class Command
19  *
20  * @package Drupal\Console\Core\Command
21  */
22 abstract class Command extends BaseCommand
23 {
24     use CommandTrait;
25
26     /**
27      * @var DrupalFinder;
28      */
29     protected $drupalFinder;
30
31     /**
32      * @var DrupalStyle
33      */
34     private $io;
35
36     /**
37      * {@inheritdoc}
38      */
39     protected function initialize(InputInterface $input, OutputInterface $output)
40     {
41         $this->io = new DrupalStyle($input, $output);
42     }
43
44     /**
45      * @return \Drupal\Console\Core\Style\DrupalStyle
46      */
47     public function getIo()
48     {
49         return $this->io;
50     }
51
52     public function createException($message) {
53         $this->getIo()->error($message);
54         exit(1);
55     }
56
57     /**
58      * @param \Drupal\Console\Core\Utils\DrupalFinder $drupalFinder
59      */
60     public function setDrupalFinder($drupalFinder) {
61         $this->drupalFinder = $drupalFinder;
62     }
63 }