Mercurial > hg > cmmr2012-drupal-site
diff vendor/symfony/console/Tester/CommandTester.php @ 4:a9cd425dd02b
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:11:55 +0000 |
parents | c75dbcec494b |
children | 12f9dff5fda9 |
line wrap: on
line diff
--- a/vendor/symfony/console/Tester/CommandTester.php Thu Feb 28 11:14:44 2019 +0000 +++ b/vendor/symfony/console/Tester/CommandTester.php Thu Feb 28 13:11:55 2019 +0000 @@ -13,9 +13,9 @@ use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\ArrayInput; -use Symfony\Component\Console\Output\StreamOutput; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Output\StreamOutput; /** * Eases the testing of console commands. @@ -28,7 +28,7 @@ private $command; private $input; private $output; - private $inputs = array(); + private $inputs = []; private $statusCode; public function __construct(Command $command) @@ -50,7 +50,7 @@ * * @return int The command exit code */ - public function execute(array $input, array $options = array()) + public function execute(array $input, array $options = []) { // set the command name automatically if the application requires // this argument and no command name was passed @@ -58,7 +58,7 @@ && (null !== $application = $this->command->getApplication()) && $application->getDefinition()->hasArgument('command') ) { - $input = array_merge(array('command' => $this->command->getName()), $input); + $input = array_merge(['command' => $this->command->getName()], $input); } $this->input = new ArrayInput($input); @@ -148,7 +148,10 @@ { $stream = fopen('php://memory', 'r+', false); - fwrite($stream, implode(PHP_EOL, $inputs)); + foreach ($inputs as $input) { + fwrite($stream, $input.PHP_EOL); + } + rewind($stream); return $stream;