Skip to content

Commit

Permalink
[console] Inject DrupalFinder to commands. (#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmolivas committed Mar 21, 2018
1 parent 957dda4 commit ca73336
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,12 @@ private function registerCommands()
);
}

if (method_exists($command, 'setDrupalFinder')) {
$command->setDrupalFinder(
$this->container->get('console.drupal_finder')
);
}

if (array_key_exists($command->getName(), $aliases)) {
$commandAliases = $aliases[$command->getName()];
if (!is_array($commandAliases)) {
Expand Down Expand Up @@ -501,6 +507,7 @@ private function registerGenerators()
if (!$generator) {
continue;
}

if (method_exists($generator, 'setRenderer')) {
$generator->setRenderer(
$this->container->get('console.renderer')
Expand Down

0 comments on commit ca73336

Please sign in to comment.