Skip to content

Commit

Permalink
Merge branch '5.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Dec 26, 2017
2 parents 93fadfb + ba5e31d commit de5963e
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/Illuminate/Console/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public function call($command, array $arguments = [])
$arguments['command'] = $command;

return $this->getApplication()->find($command)->run(
new ArrayInput($arguments), $this->output
$this->createInputFromArguments($arguments), $this->output
);
}

Expand All @@ -211,10 +211,25 @@ public function callSilent($command, array $arguments = [])
$arguments['command'] = $command;

return $this->getApplication()->find($command)->run(
new ArrayInput($arguments), new NullOutput
$this->createInputFromArguments($arguments), new NullOutput
);
}

/**
* Create an input instance from the given arguments.
*
* @param array $arguments
* @return \Symfony\Component\Console\Input\ArrayInput
*/
protected function createInputFromArguments(array $arguments)
{
return tap(new ArrayInput($arguments), function ($input) {
if ($input->hasParameterOption(['--no-interaction'], true)) {
$input->setInteractive(false);
}
});
}

/**
* Determine if the given argument is present.
*
Expand Down

0 comments on commit de5963e

Please sign in to comment.