Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Dec 26, 2017
1 parent 3979e3e commit ba5e31d
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions src/Illuminate/Console/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
public function call($command, array $arguments = [])
{
$arguments['command'] = $command;
$input = new ArrayInput($arguments);
if ($input->hasParameterOption(['--no-interaction'], true)) {
$input->setInteractive(false);
}

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

Expand All @@ -213,16 +209,27 @@ public function call($command, array $arguments = [])
public function callSilent($command, array $arguments = [])
{
$arguments['command'] = $command;
$input = new ArrayInput($arguments);
if ($input->hasParameterOption(['--no-interaction'], true)) {
$input->setInteractive(false);
}

return $this->getApplication()->find($command)->run(
$input, 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 ba5e31d

Please sign in to comment.