Skip to content

Commit

Permalink
[console] Add DrupalFinder to Command Base class. (#333)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmolivas authored Mar 21, 2018
1 parent dcbe52a commit 18992a8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Command/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Symfony\Component\Console\Output\OutputInterface;
use Drupal\Console\Core\Command\Shared\CommandTrait;
use Drupal\Console\Core\Style\DrupalStyle;
use Drupal\Console\Core\Utils\DrupalFinder;

/**
* Class Command
Expand All @@ -22,6 +23,11 @@ abstract class Command extends BaseCommand
{
use CommandTrait;

/**
* @var DrupalFinder;
*/
protected $drupalFinder;

/**
* @var DrupalStyle
*/
Expand All @@ -42,4 +48,16 @@ public function getIo()
{
return $this->io;
}

public function createException($message) {
$this->getIo()->error($message);
exit(1);
}

/**
* @param \Drupal\Console\Core\Utils\DrupalFinder $drupalFinder
*/
public function setDrupalFinder($drupalFinder) {
$this->drupalFinder = $drupalFinder;
}
}

0 comments on commit 18992a8

Please sign in to comment.