Skip to content

Commit 18992a8

Browse files
authored
[console] Add DrupalFinder to Command Base class. (#333)
1 parent dcbe52a commit 18992a8

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/Command/Command.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Symfony\Component\Console\Output\OutputInterface;
1313
use Drupal\Console\Core\Command\Shared\CommandTrait;
1414
use Drupal\Console\Core\Style\DrupalStyle;
15+
use Drupal\Console\Core\Utils\DrupalFinder;
1516

1617
/**
1718
* Class Command
@@ -22,6 +23,11 @@ abstract class Command extends BaseCommand
2223
{
2324
use CommandTrait;
2425

26+
/**
27+
* @var DrupalFinder;
28+
*/
29+
protected $drupalFinder;
30+
2531
/**
2632
* @var DrupalStyle
2733
*/
@@ -42,4 +48,16 @@ public function getIo()
4248
{
4349
return $this->io;
4450
}
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+
}
4563
}

0 commit comments

Comments
 (0)